home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 May
/
Pcwk5b98.iso
/
WEBSERVE
/
PI3
/
PI3WEB.EXE
/
DEVEL
/
INCLUDE
/
HTTPDefs.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-10-30
|
7KB
|
205 lines
/*____________________________________________________________________________*\
*
Copyright (c) 1997 John Roy. All rights reserved.
These sources, libraries and applications are
FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
as long as the following conditions are adhered to.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. Redistributions of any form whatsoever and all advertising materials
mentioning features must contain the following
acknowledgment:
"This product includes software developed by John Roy
(http://www.johnroy.com/pi3/)."
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHORS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
*____________________________________________________________________________*|
*
* $Source: HTTPDefs.h$
* $Date: Sun Aug 10 06:36:31 1997$
*
Description:
\*____________________________________________________________________________*/
/* $SourceTop:$ */
#ifndef HTTPDEFS_H_
#define HTTPDEFS_H_
/*____________________________________________________________________________*\
*
Description:
\*____________________________________________________________________________*/
#define KEY_CONF_DOCUMENTROOT "DocumentRoot"
#define KEY_CONF_MIMEFILE "MIMEFile"
#define KEY_CONF_ADDMIMEENTRY "AddMIMEEntry"
/* --- HTTP headers (incoming), sent in rfc822 pairs --- */
#define KEY_HTTP_STATUS "Status"
#define KEY_HTTP_IFMODIFIEDSINCE "If-Modified-Since"
#define KEY_HTTP_CONNECTION "Connection"
#define KEY_HTTP_URI "URI"
/* --- HTTP incoming compoents, not sent in rfc822 pairs --- */
#define KEY_HTTP_CLF "CLF"
#define KEY_HTTP_METHOD "Method"
#define KEY_HTTP_PROTOCOL "Protocol"
#define KEY_HTTP_QUERYSTRING "QueryString"
#define KEY_HTTP_PROXYPROTOCOL "ProxyProtocol"
#define KEY_HTTP_PROXYHOST "ProxyHost"
#define KEY_HTTP_PROXYPORT "ProxyPort"
/* --- outgoing --- */
#define KEY_HTTP_CONTENTTYPE "Content-Type"
#define KEY_HTTP_CONTENTLENGTH "Content-Length"
#define KEY_HTTP_CONTENTENCODING "Content-Encoding"
#define KEY_HTTP_SERVER "Server"
#define KEY_HTTP_DATE "Date"
#define KEY_HTTP_LASTMODIFIED "Last-Modified"
#define KEY_HTTP_LOCATION "Location"
#define KEY_HTTP_HOST "Host"
#define KEY_HTTP_PRAGMA "Pragma"
#define KEY_HTTP_EXPIRES "Expires"
#define KEY_HTTP_WWW_AUTHENTICATE "WWW-Authenticate"
#define KEY_HTTP_AUTHORIZATION "Authorization"
/* --- HTTP & SSL stuff --- */
#define KEY_HTTPS_KEYSIZE "KeySize"
#define KEY_HTTPS_SECRETKEYSIZE "SecretKeySize"
/* --- misc --- */
#define HTTP_DIRSEPERATOR '/'
#define HTTP_DEFAULT_PORT (80)
/* --- keys to data structures and internal values --- */
#define KEY_DS_FILEINFO "FileInfo"
#define KEY_DS_FILEMAP "FileMap"
#define KEY_INT_PATH "Path"
#define KEY_INT_OLDPATH "OldPath"
#define KEY_INT_PATHINFO "PathInfo"
#define KEY_INT_AUTHTYPE "AuthType"
#define KEY_INT_AUTHPASS "AuthPass"
#define KEY_INT_REMOTEADDR "RemoteAddr"
#define KEY_INT_REMOTEHOST "RemoteHost"
#define KEY_INT_REMOTEIDENT "RemoteIdent"
#define KEY_INT_REMOTEUSER "RemoteUser"
#define KEY_INT_LOCALADDR "LocalAddr"
#define KEY_INT_SERVERPORT "ServerPort"
#define KEY_INT_HOSTNAME "HostName"
#define KEY_INT_KEEPOPEN "KeepOpen"
#define KEY_INT_OBJECTNAME "ObjectName"
#define KEY_INT_OBJECTMAP "ObjectMap"
#define KEY_INT_TEMPORARYFILE "TemporaryFile"
#define KEY_INT_DEBUGGING "Debugging"
#define KEY_INT_PATHTRANSLATED "PathTranslated"
#define KEY_INT_SCRIPTNAME "ScriptName"
#define KEY_INT_ERRORMESSAGE "ErrorMessage"
#define KEY_INT_AUTHENTICATIONREALM "AuthenticationRealm"
#define KEY_INT_RECVTIMEOUT "RecvTimeout"
/* --- really internal values specific internal operation and profiling --- */
#define KEY_INT_SECONDS "Seconds"
#define KEY_INT_MICROSECONDS "MicroSeconds"
#define KEY_INT_BYTESSENT "BytesSent"
#define HTTP_LF (10)
#define HTTP_CR (13)
#define HTTP_CRLF "\r\n"
/* ---
Phases in request/response cycle
--- */
#define PH_INVALID (-1)
#define PH_INIT 0
#define PH_HEADERS 1
#define PH_HOSTMAP 2
#define PH_MAPPING 3
#define PH_CHECKPATH 4
#define PH_CHECKAUTH 5
#define PH_CHECKACCESS 6
#define PH_CHECKTYPE 7
#define PH_HANDLE 8
#define PH_LOG 9
#define PH_DESTROY 10
#define PH_NUMBER 11
/* ---
HTTP Status codes
--- */
#define ST_OK 200
#define ST_PERMANENTREDIRECT 301
#define ST_NOTMODIFIED 304
#define ST_BADREQUEST 400
#define ST_UNAUTHORIZED 401
#define ST_FORBIDDEN 403
#define ST_NOTFOUND 404
#define ST_INTERNALERROR 500
#define ST_NOTIMPLEMENTED 501
/* ---
Return codes
--- */
#define INT_CONTINUE 0
#define INT_REDIRECT 1
/* ---
HTTP Methods
--- */
#define MD_NAME_GET "GET"
#define MD_NAME_POST "POST"
#define MD_NAME_HEAD "HEAD"
#define MD_UNKNOWN 0
#define MD_GET 1
#define MD_POST 2
#define MD_HEAD 3
/* ---
HTTP Protocols
--- */
#define PR_NAME_HTTP09 "HTTP/0.9"
#define PR_NAME_HTTP10 "HTTP/1.0"
#define PR_NAME_HTTP11 "HTTP/1.1"
#define PR_NAME_UNKNOWN "Unknown"
#define PR_UNKNOWN 0
#define PR_HTTP09 1
#define PR_HTTP10 2
#define PR_HTTP11 3
/* ---
Content-Types
--- */
#define TYPE_MAGIC_DIRECTORY "internal/x-directory"
#define TYPE_MAGIC_CGI "internal/x-cgi"
#define TYPE_MAGIC_SSI "internal/x-server-parsed-html"
/* ---
Defaults
--- */
#define HTTP_DEFAULT_MIME_TYPE "application/octet-stream"
#endif /* HTTPDEFS_H_ */