source: rtems/cpukit/httpd/wsIntrn.h @ 4e97166

4.104.114.84.95
Last change on this file since 4e97166 was ee3afa2, checked in by Joel Sherrill <joel.sherrill@…>, on 04/11/03 at 14:46:55

2002-04-10 Mike Siers <mikes@…>

  • rtems_webserver/NOTES, rtems_webserver/asp.c, rtems_webserver/balloc.c, rtems_webserver/default.c, rtems_webserver/ej.h, rtems_webserver/ejIntrn.h, rtems_webserver/ejlex.c, rtems_webserver/ejparse.c, rtems_webserver/emfdb.c, rtems_webserver/emfdb.h, rtems_webserver/form.c, rtems_webserver/h.c, rtems_webserver/handler.c, rtems_webserver/license.txt, rtems_webserver/md5.h, rtems_webserver/md5c.c, rtems_webserver/mime.c, rtems_webserver/misc.c, rtems_webserver/ringq.c, rtems_webserver/rom.c, rtems_webserver/security.c, rtems_webserver/sock.c, rtems_webserver/sym.c, rtems_webserver/uemf.c, rtems_webserver/uemf.h, rtems_webserver/um.c, rtems_webserver/um.h, rtems_webserver/url.c, rtems_webserver/value.c, rtems_webserver/wbase64.c, rtems_webserver/webcomp.c, rtems_webserver/webpage.c, rtems_webserver/webrom.c, rtems_webserver/webs.c, rtems_webserver/webs.h, rtems_webserver/websuemf.c, rtems_webserver/wsIntrn.h: Update to GoAhead? Webserver 2.1.4. The following URL is the release notes from GoAhead?.

http://data.goahead.com/Software/Webserver/2.1.4/release.htm

I have only done a minimal amount of testing (i.e. the network
demo program works fine). Please try this out and let me know
if it works. The patch needs to be applied on the
c/src/libnetworking/rtems_webserver directory.

  • Property mode set to 100644
File size: 8.4 KB
Line 
1/*
2 *      wsIntrn.h -- Internal GoAhead Web server header
3 *
4 * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved.
5 *
6 *      See the file "license.txt" for information on usage and redistribution
7 *
8 * $Id$
9 */
10 
11#ifndef _h_WEBS_INTERNAL
12#define _h_WEBS_INTERNAL 1
13
14/******************************** Description *********************************/
15
16/*
17 *      Internal GoAhead Web Server header. This defines the Web private APIs
18 *      Include this header when you want to create URL handlers.
19 */
20
21/*********************************** Defines **********************************/
22
23/*
24 *      Define this to enable logging of web accesses to a file
25 *              #define WEBS_LOG_SUPPORT 1
26 *
27 *      Define this to enable HTTP/1.1 keep alive support
28 *              #define WEBS_KEEP_ALIVE_SUPPORT 1
29 *
30 *      Define this to enable if-modified-since support
31 *              #define WEBS_IF_MODIFIED_SUPPORT 1
32 *
33 *      Define this to support proxy capability and track local vs remote request
34 *              Note: this is not yet fully implemented.
35 *              #define WEBS_PROXY_SUPPORT 1
36 *
37 *      Define this to support reading pages from ROM
38 *              #define WEBS_PAGE_ROM 1
39 *
40 *      Define this to enable memory allocation and stack usage tracking
41 *              #define B_STATS 1
42 */
43
44/********************************** Includes **********************************/
45
46#include        <ctype.h>
47#include        <stdlib.h>
48#include        <string.h>
49#include        <stdarg.h>
50
51#ifdef NETWARE
52        #include        <fcntl.h>
53        #include        <sys/stat.h>
54        #include        <signal.h>
55        #include        <io.h>
56#endif
57
58#ifdef WIN
59        #include        <fcntl.h>
60        #include        <sys/stat.h>
61        #include        <io.h>
62#endif
63
64#ifdef CE
65#ifndef UEMF
66        #include        <io.h>
67#endif
68#endif
69
70#ifdef NW
71        #include        <fcntl.h>
72        #include        <sys/stat.h>
73#endif
74
75#ifdef SCOV5
76        #include        <fcntl.h>
77        #include        <sys/stat.h>
78        #include        <signal.h>
79        #include        <unistd.h>
80#endif
81
82#ifdef LYNX
83        #include        <fcntl.h>
84        #include        <sys/stat.h>
85        #include        <signal.h>
86        #include        <unistd.h>
87#endif
88
89#ifdef UNIX
90        #include        <fcntl.h>
91        #include        <sys/stat.h>
92        #include        <signal.h>
93        #include        <unistd.h>
94#endif
95
96#ifdef QNX4
97        #include        <fcntl.h>
98        #include        <sys/stat.h>
99        #include        <signal.h>
100        #include        <unistd.h>
101        #include        <unix.h>
102#endif
103
104#ifdef UW
105        #include        <fcntl.h>
106        #include        <sys/stat.h>
107#endif
108
109#ifdef VXWORKS
110        #include        <vxWorks.h>
111        #include        <fcntl.h>
112        #include        <sys/stat.h>
113#endif
114
115#ifdef SOLARIS
116        #include        <macros.h>
117        #include        <fcntl.h>
118        #include        <sys/stat.h>
119#endif
120
121#ifdef UEMF
122        #include        "uemf.h"
123        #include        "ejIntrn.h"
124#else
125        #include        "emf/emfInternal.h"
126        #include        "ej/ejIntrn.h"
127#endif
128
129#include        "webs.h"
130
131/********************************** Defines ***********************************/
132/*
133 *      Read handler flags and state
134 */
135#define WEBS_BEGIN                      0x1                     /* Beginning state */
136#define WEBS_HEADER                     0x2                     /* Ready to read first line */
137#define WEBS_POST                       0x4                     /* POST without content */
138#define WEBS_POST_CLEN          0x8                     /* Ready to read content for POST */
139#define WEBS_PROCESSING         0x10            /* Processing request */
140#define WEBS_KEEP_TIMEOUT       15000           /* Keep-alive timeout (15 secs) */
141#define WEBS_TIMEOUT            60000           /* General request timeout (60) */
142
143#define PAGE_READ_BUFSIZE       512                     /* bytes read from page files */
144#define MAX_PORT_LEN            10                      /* max digits in port number */
145#define WEBS_SYM_INIT           64                      /* initial # of sym table entries */
146
147/*
148 *      URL handler structure. Stores the leading URL path and the handler
149 *      function to call when the URL path is seen.
150 */
151typedef struct {
152        int             (*handler)(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg,
153                        char_t *url, char_t *path,
154                        char_t *query);                                 /* Callback URL handler function */
155        char_t  *webDir;                                                /* Web directory if required */
156        char_t  *urlPrefix;                                             /* URL leading prefix */
157        int             len;                                                    /* Length of urlPrefix for speed */
158        int             arg;                                                    /* Argument to provide to handler */
159        int             flags;                                                  /* Flags */
160} websUrlHandlerType;
161
162/*
163 *      Webs statistics
164 */
165typedef struct {
166        long                    errors;                                 /* General errors */
167        long                    redirects;
168        long                    net_requests;
169        long                    activeNetRequests;
170        long                    activeBrowserRequests;
171        long                    timeouts;
172        long                    access;                                 /* Access violations */
173        long                    localHits;
174        long                    remoteHits;
175        long                    formHits;
176        long                    cgiHits;
177        long                    handlerHits;
178} websStatsType;
179
180extern websStatsType websStats;                         /* Web access stats */
181
182/*
183 *      Error code list
184 */
185typedef struct {
186        int             code;                                                   /* HTTP error code */
187        char_t  *msg;                                                   /* HTTP error message */
188} websErrorType;
189
190/*
191 *      Mime type list
192 */
193typedef struct {
194        char_t  *type;                                                  /* Mime type */
195        char_t  *ext;                                                   /* File extension */
196} websMimeType;
197
198/*
199 *      File information structure.
200 */
201typedef struct {
202        unsigned long   size;                                   /* File length */
203        int                             isDir;                                  /* Set if directory */
204        time_t                  mtime;                                  /* Modified time */
205} websStatType;
206
207/*
208 *      Compiled Rom Page Index
209 */
210typedef struct {
211        char_t                  *path;                                  /* Web page URL path */
212        unsigned char   *page;                                  /* Web page data */
213        int                             size;                                   /* Size of web page in bytes */
214        int                             pos;                                    /* Current read position */
215} websRomPageIndexType;
216
217/*
218 *      Defines for file open.
219 */
220#ifndef CE
221#define SOCKET_RDONLY   O_RDONLY
222#define SOCKET_BINARY   O_BINARY
223#else /* CE */
224#define SOCKET_RDONLY   0x1
225#define SOCKET_BINARY   0x2
226#endif /* CE */
227
228extern websRomPageIndexType     websRomPageIndex[];
229extern websMimeType             websMimeList[];         /* List of mime types */
230extern sym_fd_t                 websMime;                       /* Set of mime types */
231extern webs_t*                  webs;                           /* Session list head */
232extern int                              websMax;                        /* List size */
233extern char_t                   websHost[64];           /* Name of this host */
234extern char_t                   websIpaddr[64];         /* IP address of this host */
235extern char_t                   *websHostUrl;           /* URL for this host */
236extern char_t                   *websIpaddrUrl;         /* URL for this host */
237extern int                              websPort;                       /* Port number */
238
239/******************************** Prototypes **********************************/
240
241extern int               websAspOpen();
242extern void              websAspClose();
243extern void              websFormOpen();
244extern void              websFormClose();
245extern int               websAspWrite(int ejid, webs_t wp, int argc, char_t **argv);
246extern void      websDefaultClose();
247extern int               websDefaultHandler(webs_t wp, char_t *urlPrefix,
248                                        char_t *webDir, int arg, char_t *url, char_t *path,
249                                        char_t *query);
250extern int               websFormHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
251                                        int arg, char_t *url, char_t *path, char_t *query);
252extern int               websCgiHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
253                                        int arg, char_t *url, char_t *path, char_t *query);
254extern void              websCgiCleanup();
255extern int               websCheckCgiProc(int handle);
256extern char_t    *websGetCgiCommName();
257
258extern int               websLaunchCgiProc(char_t *cgiPath, char_t **argp,
259                                        char_t **envp, char_t *stdIn, char_t *stdOut);
260extern int               websOpen(int sid);
261extern void      websResponse(webs_t wp, int code, char_t *msg,
262                                        char_t *redirect);
263extern int               websJavaScriptEval(webs_t wp, char_t *script);
264extern int               websPageReadData(webs_t wp, char *buf, int nBytes);
265extern int               websPageOpen(webs_t wp, char_t *lpath, char_t *path, int mode,
266                                        int perm);
267extern void              websPageClose(webs_t wp);
268extern void              websPageSeek(webs_t wp, long offset);
269extern int               websPageStat(webs_t wp, char_t *lpath, char_t *path,
270                                        websStatType *sbuf);
271extern int               websPageIsDirectory(char_t *lpath);
272extern int               websRomOpen();
273extern void              websRomClose();
274extern int               websRomPageOpen(webs_t wp, char_t *path, int mode, int perm);
275extern void      websRomPageClose(int fd);
276extern int               websRomPageReadData(webs_t wp, char *buf, int len);
277extern int               websRomPageStat(char_t *path, websStatType *sbuf);
278extern long              websRomPageSeek(webs_t wp, long offset, int origin);
279extern void      websSetRequestSocketHandler(webs_t wp, int mask,
280                                        void (*fn)(webs_t wp));
281extern int               websSolutionHandler(webs_t wp, char_t *urlPrefix,
282                                        char_t *webDir, int arg, char_t *url, char_t *path,
283                                        char_t *query);
284extern void      websUrlHandlerClose();
285extern int               websUrlHandlerOpen();
286extern int               websOpenServer(int port, int retries);
287extern void      websCloseServer();
288extern char_t*   websGetDateString(websStatType* sbuf);
289
290extern int              strcmpci(char_t* s1, char_t* s2);
291
292/*
293 *      Prototypes for functions available when running as part of the
294 *      GoAhead Embedded Management Framework (EMF)
295 */
296#ifdef EMF
297extern int               websEmfOpen();
298extern void      websEmfClose();
299extern void      websSetEmfEnvironment(webs_t wp);
300#endif
301
302#ifdef CE
303extern int writeUniToAsc(int fid, void *buf, unsigned int len);
304extern int readAscToUni(int fid, void **buf, unsigned int len);
305#endif
306
307#endif /* _h_WEBS_INTERNAL */
308
309/******************************************************************************/
Note: See TracBrowser for help on using the repository browser.