source: rtems/cpukit/httpd/webs.h @ ee3afa2

4.104.114.84.95
Last change on this file since ee3afa2 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: 9.6 KB
Line 
1/*
2 *      webs.h -- GoAhead Web public 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
12#define _h_WEBS 1
13
14/******************************** Description *********************************/
15
16/*
17 *      GoAhead Web Server header. This defines the Web public APIs.
18 *      Include this header for files that contain ASP or Form procedures.
19 *      Include wsIntrn.h when creating URL handlers.
20 */
21
22/********************************* Includes ***********************************/
23
24#include        "ej.h"
25#ifdef WEBS_SSL_SUPPORT
26        #include        "websSSL.h"
27#endif
28
29/********************************** Defines ***********************************/
30/*
31 *      By license terms the server software name defined in the following line of
32 *      code must not be modified.
33 */
34#define WEBS_NAME                               T("GoAhead-Webs")
35#define WEBS_VERSION                    T("2.1.3")
36
37#define WEBS_HEADER_BUFINC              512                     /* Header buffer size */
38#define WEBS_ASP_BUFINC                 512                     /* Asp expansion increment */
39#define WEBS_MAX_PASS                   32                      /* Size of password */
40#define WEBS_BUFSIZE                    1000            /* websWrite max output string */
41#define WEBS_MAX_HEADER                 (5 * 1024)      /* Sanity check header */
42#define WEBS_MAX_URL                    4096            /* Maximum URL size for sanity */
43#define WEBS_SOCKET_BUFSIZ              256                     /* Bytes read from socket */
44
45#define WEBS_HTTP_PORT                  T("httpPort")
46#define CGI_BIN                                 T("cgi-bin")
47
48/*
49 *      Request flags. Also returned by websGetRequestFlags().
50 */
51#define WEBS_LOCAL_PAGE                 0x1                     /* Request for local webs page */
52#define WEBS_KEEP_ALIVE                 0x2                     /* HTTP/1.1 keep alive */
53#define WEBS_DONT_USE_CACHE             0x4                     /* Not implemented cache support */
54#define WEBS_COOKIE                             0x8                     /* Cookie supplied in request */
55#define WEBS_IF_MODIFIED                0x10            /* If-modified-since in request */
56#define WEBS_POST_REQUEST               0x20            /* Post request operation */
57#define WEBS_LOCAL_REQUEST              0x40            /* Request from this system */
58#define WEBS_HOME_PAGE                  0x80            /* Request for the home page */
59#define WEBS_ASP                                0x100           /* ASP request */
60#define WEBS_HEAD_REQUEST               0x200           /* Head request */
61#define WEBS_CLEN                               0x400           /* Request had a content length */
62#define WEBS_FORM                               0x800           /* Request is a form */
63#define WEBS_REQUEST_DONE               0x1000          /* Request complete */
64#define WEBS_POST_DATA                  0x2000          /* Already appended post data */
65#define WEBS_CGI_REQUEST                0x4000          /* cgi-bin request */
66#define WEBS_SECURE                             0x8000          /* connection uses SSL */
67#define WEBS_AUTH_BASIC                 0x10000         /* Basic authentication request */
68#define WEBS_AUTH_DIGEST                0x20000         /* Digest authentication request */
69#define WEBS_HEADER_DONE                0x40000         /* Already output the HTTP header */
70
71/*
72 *      URL handler flags
73 */
74#define WEBS_HANDLER_FIRST      0x1                     /* Process this handler first */
75#define WEBS_HANDLER_LAST       0x2                     /* Process this handler last */
76
77/*
78 *      Per socket connection webs structure
79 */
80typedef struct websRec {
81        ringq_t                 header;                         /* Header dynamic string */
82        time_t                  since;                          /* Parsed if-modified-since time */
83        sym_fd_t                cgiVars;                        /* CGI standard variables */
84        sym_fd_t                cgiQuery;                       /* CGI decoded query string */
85        time_t                  timestamp;                      /* Last transaction with browser */
86        int                             timeout;                        /* Timeout handle */
87        char_t                  ipaddr[32];                     /* Connecting ipaddress */
88        char_t                  type[64];                       /* Mime type */
89        char_t                  *dir;                           /* Directory containing the page */
90        char_t                  *path;                          /* Path name without query */
91        char_t                  *url;                           /* Full request url */
92        char_t                  *host;                          /* Requested host */
93        char_t                  *lpath;                         /* Cache local path name */
94        char_t                  *query;                         /* Request query */
95        char_t                  *decodedQuery;          /* Decoded request query */
96        char_t                  *authType;                      /* Authorization type (Basic/DAA) */
97        char_t                  *password;                      /* Authorization password */
98        char_t                  *userName;                      /* Authorization username */
99        char_t                  *cookie;                        /* Cookie string */
100        char_t                  *userAgent;                     /* User agent (browser) */
101        char_t                  *protocol;                      /* Protocol (normally HTTP) */
102        char_t                  *protoVersion;          /* Protocol version */
103        int                             sid;                            /* Socket id (handler) */
104        int                             listenSid;                      /* Listen Socket id */
105        int                             port;                           /* Request port number */
106        int                             state;                          /* Current state */
107        int                             flags;                          /* Current flags -- see above */
108        int                             code;                           /* Request result code */
109        int                             clen;                           /* Content length */
110        int                             wid;                            /* Index into webs */
111        char_t                  *cgiStdin;                      /* filename for CGI stdin */
112        int                             docfd;                          /* Document file descriptor */
113        int                             numbytes;                       /* Bytes to transfer to browser */
114        int                             written;                        /* Bytes actually transferred */
115        void                    (*writeSocket)(struct websRec *wp);
116#ifdef DIGEST_ACCESS_SUPPORT
117    char_t                      *realm;         /* usually the same as "host" from websRec */
118    char_t                      *nonce;         /* opaque-to-client string sent by server */
119    char_t                      *digest;        /* digest form of user password */
120    char_t                      *uri;           /* URI found in DAA header */
121    char_t                      *opaque;        /* opaque value passed from server */
122    char_t                      *nc;            /* nonce count */
123    char_t                      *cnonce;        /* check nonce */
124    char_t                      *qop;           /* quality operator */
125#endif
126#ifdef WEBS_SSL_SUPPORT
127        websSSL_t               *wsp;           /* SSL data structure */
128#endif
129} websRec;
130
131typedef websRec *webs_t;
132typedef websRec websType;
133
134/******************************** Prototypes **********************************/
135extern int               websAccept(int sid, char *ipaddr, int port, int listenSid);
136extern int               websAspDefine(char_t *name,
137                                        int (*fn)(int ejid, webs_t wp, int argc, char_t **argv));
138extern int               websAspRequest(webs_t wp, char_t *lpath);
139extern void              websCloseListen();
140extern int               websDecode64(char_t *outbuf, char_t *string, int buflen);
141extern void              websDecodeUrl(char_t *token, char_t *decoded, int len);
142extern void      websDone(webs_t wp, int code);
143extern void      websEncode64(char_t *outbuf, char_t *string, int buflen);
144extern void      websError(webs_t wp, int code, char_t *msg, ...);
145/* function websErrorMsg() made extern 03 Jun 02 BgP */
146extern char_t   *websErrorMsg(int code);
147extern void      websFooter(webs_t wp);
148extern int               websFormDefine(char_t *name, void (*fn)(webs_t wp,
149                                        char_t *path, char_t *query));
150extern char_t   *websGetDefaultDir();
151extern char_t   *websGetDefaultPage();
152extern char_t   *websGetHostUrl();
153extern char_t   *websGetIpaddrUrl();
154extern char_t   *websGetPassword();
155extern int               websGetPort();
156extern char_t   *websGetPublishDir(char_t *path, char_t **urlPrefix);
157extern char_t   *websGetRealm();
158extern int               websGetRequestBytes(webs_t wp);
159extern char_t   *websGetRequestDir(webs_t wp);
160extern int               websGetRequestFlags(webs_t wp);
161extern char_t   *websGetRequestIpaddr(webs_t wp);
162extern char_t   *websGetRequestLpath(webs_t wp);
163extern char_t   *websGetRequestPath(webs_t wp);
164extern char_t   *websGetRequestPassword(webs_t wp);
165extern char_t   *websGetRequestType(webs_t wp);
166extern int               websGetRequestWritten(webs_t wp);
167extern char_t   *websGetVar(webs_t wp, char_t *var, char_t *def);
168extern int               websCompareVar(webs_t wp, char_t *var, char_t *value);
169extern void      websHeader(webs_t wp);
170extern int               websOpenListen(int port, int retries);
171extern int               websPageOpen(webs_t wp, char_t *lpath, char_t *path,
172                                        int mode, int perm);
173extern void      websPageClose(webs_t wp);
174extern int               websPublish(char_t *urlPrefix, char_t *path);
175extern void              websRedirect(webs_t wp, char_t *url);
176extern void      websSecurityDelete();
177extern int               websSecurityHandler(webs_t wp, char_t *urlPrefix,
178                                        char_t *webDir, int arg, char_t *url, char_t *path,
179                                        char_t *query);
180extern void      websSetDefaultDir(char_t *dir);
181extern void      websSetDefaultPage(char_t *page);
182extern void      websSetEnv(webs_t wp);
183extern void      websSetHost(char_t *host);
184extern void      websSetIpaddr(char_t *ipaddr);
185extern void      websSetPassword(char_t *password);
186extern void      websSetRealm(char_t *realmName);
187extern void      websSetRequestBytes(webs_t wp, int bytes);
188extern void              websSetRequestFlags(webs_t wp, int flags);
189extern void      websSetRequestLpath(webs_t wp, char_t *lpath);
190extern void      websSetRequestPath(webs_t wp, char_t *dir, char_t *path);
191extern char_t   *websGetRequestUserName(webs_t wp);
192extern void      websSetRequestWritten(webs_t wp, int written);
193extern void      websSetVar(webs_t wp, char_t *var, char_t *value);
194extern int               websTestVar(webs_t wp, char_t *var);
195extern void              websTimeoutCancel(webs_t wp);
196extern int               websUrlHandlerDefine(char_t *urlPrefix, char_t *webDir,
197                                        int arg, int (*fn)(webs_t wp, char_t *urlPrefix,
198                                        char_t *webDir, int arg, char_t *url, char_t *path,
199                                        char_t *query), int flags);
200extern int               websUrlHandlerDelete(int (*fn)(webs_t wp, char_t *urlPrefix,
201                                        char_t *webDir, int arg, char_t *url, char_t *path,
202                                        char_t *query));
203extern int               websUrlHandlerRequest(webs_t wp);
204extern int               websUrlParse(char_t *url, char_t **buf, char_t **host,
205                                        char_t **path, char_t **port, char_t **query,
206                                        char_t **proto, char_t **tag, char_t **ext);
207extern char_t   *websUrlType(char_t *webs, char_t *buf, int charCnt);
208extern int               websWrite(webs_t wp, char_t* fmt, ...);
209extern int               websWriteBlock(webs_t wp, char_t *buf, int nChars);
210extern int               websWriteDataNonBlock(webs_t wp, char *buf, int nChars);
211extern int               websValid(webs_t wp);
212extern int               websValidateUrl(webs_t wp, char_t *path);
213extern void             websSetTimeMark(webs_t wp);
214
215/*
216 *      The following prototypes are used by the SSL patch found in websSSL.c
217 */
218extern int              websAlloc(int sid);
219extern void     websFree(webs_t wp);
220extern void     websTimeout(void *arg, int id);
221extern void     websReadEvent(webs_t wp);
222
223/*
224 *      Prototypes for functions available when running as part of the
225 *      GoAhead Embedded Management Framework (EMF)
226 */
227#ifdef EMF
228extern void      websFormExplain(webs_t wp, char_t *path, char_t *query);
229#endif
230
231#endif /* _h_WEBS */
232
233/******************************************************************************/
Note: See TracBrowser for help on using the repository browser.