214 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			214 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| compile insert ps_HTTPServer_Equates
 | |
| /* 
 | |
|    ** Copyright (C) 2012-2021 Revelation Software Inc. All Rights Reserved **
 | |
|    
 | |
|    Author   : Wile C Coyote - Super Genius
 | |
|    Date     : January 2020
 | |
|    Purpose  : Constants for working with PS HTTPSERVER objects
 | |
|    
 | |
|    
 | |
|    Comments
 | |
|    ========
 | |
|    
 | |
|    
 | |
|    Amended  Date        Reason
 | |
|    =======  ====        ======
 | |
|    Mr C     19 May 23   Corrected STARTUPMODE equates
 | |
|    Mr C     31 Aug 22   Added "preserve-case" styles
 | |
|    Mr C     26 Aug 22   Added STARTUPMODE support
 | |
| */
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| #ifndef _PS_HTTPSERVER_EQUATES_
 | |
| #define _PS_HTTPSERVER_EQUATES_
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
|    // HTTPSERVER's are basically derived STATIC controls so most STATIC 
 | |
|    // constants apply here as well 
 | |
|    $insert ps_Static_Equates
 | |
|    
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
|    // PS Style Equates
 | |
|    equ PSS_HSV_MANUALSTART$             to 0x00000001              ; // STARTUPMODE property
 | |
|    equ PSS_HSV_PRESERVECOOKIECASE$      to 0x00000002              ; // PRESERVECOOKIENAMECASE property
 | |
|    equ PSS_HSV_PRESERVEHEADERCASE$      to 0x00000008              ; // PRESERVEHEADERNAMECASE property
 | |
|    equ PSS_HSV_PRESERVEQUERYCASE$       to 0x00000010              ; // PRESERVEQUERYNAMECASE property
 | |
|    
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
|    
 | |
|    // SYSREPOSWINS structure overrides
 | |
|    equ POS_HSV_PORT$                    to POS_TEXT_1$             ; // PORT property
 | |
|    equ POS_HSV_CONNINFO$                to POS_TEXT_2$             ; // TIMEOUT/IPVERSION/MAXCONN
 | |
|    equ POS_HSV_IPWHITELIST$             to POS_TEXT_3$             ; // IPWHITELIST property
 | |
|    
 | |
|    // SYSREPOSWINEXES structure overrides
 | |
|    equ PSPOS_HSV_PORT$                  to PSPOS_TEXT_1$           ; // PORT property
 | |
|    equ PSPOS_HSV_CONNINFO$              to PSPOS_TEXT_2$           ; // TIMEOUT/IPVERSION/MAXCONN
 | |
|    equ PSPOS_HSV_IPWHITELIST$           to PSPOS_TEXT_3$           ; // IPWHITELIST property
 | |
|    
 | |
|    ////////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
|    // ConnInfo field (POS_HCL_CONNINFO$, PSPOS_HCL_CONNINFO$)
 | |
|    //
 | |
|    //    <0,0,1> ConnectionTimeout
 | |
|    //    <0,0,2> IpVersion
 | |
|    //    <0,0,3> MaxConnections
 | |
|    equ PS_HSV_CI_POS_TIMEOUT$          to 1
 | |
|    equ PS_HSV_CI_POS_IPVERSION$        to 2
 | |
|    equ PS_HSV_CI_POS_MAXCONN$          to 3
 | |
| 
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
|    // CONNECTIONTIMEOUT property (in seconds)
 | |
|    equ PS_HSV_DFLT_TIMEOUT$            to 0 ; // Infinity (but not beyond)
 | |
|    equ PS_HSV_MIN_TIMEOUT$             to 0 ; // Infinity
 | |
|    equ PS_HSV_MAX_TIMEOUT$             to ( 60 * 60 ) ; // 1 hour
 | |
|    
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
|    // IPVERSION property
 | |
|    equ PS_HSV_IPVERSION_IP4$           to 0
 | |
|    equ PS_HSV_IPVERSION_IP6$           to 1
 | |
|    equ PS_HSV_IPVERSION_DUALSTACK$     to 2
 | |
|    
 | |
|    equ PS_HSV_DFLT_IPVERSION$          to PS_HSV_IPVERSION_IP4$
 | |
|    
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
|    // MAXCONNECTIONS property
 | |
|    equ PS_HSV_DFLT_MAXCONN$            to 60; // (FD_SETSIZE - 4); ==> 60
 | |
|    equ PS_HSV_MIN_MAXCONN$             to 1 ; // Don't do this :)
 | |
|    equ PS_HSV_MAX_MAXCONN$             to PS_HSV_DFLT_MAXCONN$
 | |
|    
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
|    // STARTUPMODE property   
 | |
|    equ HSV_STARTMODE_AUTO$             to 0
 | |
|    equ HSV_STARTMODE_MANUAL$           to 1
 | |
|    
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
|    // HTTPREQUEST event  (requestID, requestHeaders)
 | |
|    //
 | |
|    //    requestID      : ID of the request that triggered the event. This ID  
 | |
|    //                   : must be used with the methods that set response
 | |
|    //                   : content.
 | |
|    //                   :
 | |
|    //    requestHeaders : @fm'd list of request header information. This is 
 | |
|    //                   : loosely based on the same struct as for an OECGI
 | |
|    //                   : request (see INET_EQUATES), but with a few 
 | |
|    //                   : differences
 | |
|    //
 | |
|    // -------------------------------------------------------------------------
 | |
|    // requestHeaders array structure:
 | |
|    // 
 | |
|    //    <1>  QueryString        - Not used (see QueryNames and QueryValues)
 | |
|    //    <2>  PathInfo           - Path info from URL (See below)
 | |
|    //    <3>  ContentType        - "Content-Type" header
 | |
|    //    <4>  ContentLength      - "Content-Length" header
 | |
|    //    <5>  GatewayInterface   - CGI version
 | |
|    //    <6>  HTTPS              - "on" if called through a secure port
 | |
|    //    <7>  HTTPAccept         - "Accept" Header
 | |
|    //    <8>  HTTPCookie         - "Cookie" Header
 | |
|    //    <9>  HTTPFrom           - "From" Header
 | |
|    //    <10> HTTPReferrer       - "Referer" Header
 | |
|    //    <11> HTTPUserAgent      - "User-Agent" Header
 | |
|    //    <12> PathTranslated     - Resolved "OS path" of the request
 | |
|    //    <13> RemoteAddr         - Client IP Address (decimal-dot)
 | |
|    //    <14> RemoteHost         - Client IP Address (decimal-dot)
 | |
|    //    <15> RemoteIdent        - Not used (we don't do a lookup)
 | |
|    //    <16> RemoteUser         - Client Username
 | |
|    //    <17> RequestMethod      - Request Method (GET,POST etc)
 | |
|    //    <18> ScriptName         - Script portion of URL (See Below)
 | |
|    //    <19> ServerName         - Fully Qualified domain name (e.g. www.cgi101.com) - "Host" header
 | |
|    //    <20> ServerPort         - TCPIP Port server is listening on
 | |
|    //    <21> ServerProtocol     - HTTP version
 | |
|    //    <22> ServerSoftware     - Server software string
 | |
|    //    <23> ServerURL          - URL
 | |
|    //    <24> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <25> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <26> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <27> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <28> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <29> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <30> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <31> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <32> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <33> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <34> <reserved>         - Reserved for INET_EQUATES compatibility
 | |
|    //    <35> HeaderNames        - @vm delimited list of all Header names
 | |
|    //    <36> HeaderValues       - @vm delimited list of all Header values
 | |
|    //    <37> QueryNames         - @vm delimited list of all Query names
 | |
|    //    <38> QueryValues        - @vm delimited list of all Query values
 | |
|    //    <39> CookieNames        - @vm delimited list of all Cookie names
 | |
|    //    <40> CookieValues       - @vm delimited list of all Cookie values
 | |
|    //
 | |
|    //    Parsing the URL:
 | |
|    //    
 | |
|    //       http://www.TSite.com/art/gallery.cgi/mammals?animal=dog&color=black
 | |
|    //
 | |
|    //          HOST            : www.TSite.com (+ port if it's there)
 | |
|    //          SCRIPT_NAME     : /art/gallery.cgi
 | |
|    //          PATH_INFO       : /mammals
 | |
|    //          PATH_TRANSLATED : <revboot>\art\gallery.cgi
 | |
|    //          QUERY           : animal=dog&color=black
 | |
|    //
 | |
|    //       http://domain.tld/mydir/some_cgi_script.pl
 | |
|    //
 | |
|    //          HOST            : domain.tld
 | |
|    //          SCRIPT_NAME     : /mydir/some_cgi_script.pl
 | |
|    //          PATH_INFO       : /mydir/some_cgi_script.pl
 | |
|    //          PATH_TRANSLATED : <revboot>\mydir\some_cgi_script.pl
 | |
|    //          QUERY           : ""
 | |
|    //
 | |
|    //    The problem we have with this is that a "normal" web-server can
 | |
|    //    identify the script from the URL because it knows how to map ".pl",
 | |
|    //    ".exe" and ".dll" files etc, so it can work out where the path
 | |
|    //    info starts.  We can't really do that - so we assume that the path 
 | |
|    //    info is the last part of the URL, and the script name is everything 
 | |
|    //    before that.  
 | |
|    
 | |
|    equ PS_HSVR_REQHDR_UNUSED$              to 1
 | |
|    equ PS_HSVR_REQHDR_PATHINFO$            to 2
 | |
|    equ PS_HSVR_REQHDR_CONTENTTYPE$         to 3
 | |
|    equ PS_HSVR_REQHDR_CONTENTLEN$          to 4
 | |
|    equ PS_HSVR_REQHDR_GATEWAYINTERFACE$    to 5
 | |
|    equ PS_HSVR_REQHDR_HTTPS$               to 6
 | |
|    equ PS_HSVR_REQHDR_HTTPACCEPT$          to 7
 | |
|    equ PS_HSVR_REQHDR_HTTPCOOKIE$          to 8
 | |
|    equ PS_HSVR_REQHDR_HTTPFROM$            to 9
 | |
|    equ PS_HSVR_REQHDR_HTTPREFERRER$        to 10
 | |
|    equ PS_HSVR_REQHDR_HTTPUSERAGENT$       to 11
 | |
|    equ PS_HSVR_REQHDR_PATHTRANSLATED$      to 12
 | |
|    equ PS_HSVR_REQHDR_REMOTEADDR$          to 13
 | |
|    equ PS_HSVR_REQHDR_REMOTEHOST$          to 14
 | |
|    equ PS_HSVR_REQHDR_REMOTEIDENT$         to 15
 | |
|    equ PS_HSVR_REQHDR_REMOTEUSER$          to 16
 | |
|    equ PS_HSVR_REQHDR_REQUESTMETHOD$       to 17
 | |
|    equ PS_HSVR_REQHDR_SCRIPTNAME$          to 18
 | |
|    equ PS_HSVR_REQHDR_SERVERNAME$          to 19
 | |
|    equ PS_HSVR_REQHDR_SERVERPORT$          to 20
 | |
|    equ PS_HSVR_REQHDR_SERVERPROTOCOL$      to 21
 | |
|    equ PS_HSVR_REQHDR_SERVERSOFTWARE$      to 22
 | |
|    equ PS_HSVR_REQHDR_SERVERURL$           to 23
 | |
|    
 | |
|    //  Fields 24-34 reserved for INET_EQUATES compatibility
 | |
|    
 | |
|    equ PS_HSVR_REQHDR_HEADERNAMES$         to 35 ; // Headers AMV
 | |
|    equ PS_HSVR_REQHDR_HEADERVALUES$        to 36 ; // Headers AMV
 | |
|    equ PS_HSVR_REQHDR_QUERYNAMES$          to 37 ; // Query AMV
 | |
|    equ PS_HSVR_REQHDR_QUERYVALUES$         to 38 ; // Query AMV
 | |
|    equ PS_HSVR_REQHDR_COOKIENAMES$         to 39 ; // Cookies AMV
 | |
|    equ PS_HSVR_REQHDR_COOKIEVALUES$        to 40 ; // Cookies AMV
 | |
|    
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| #endif
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| ///////////////////////////////////////////////////////////////////////////////
 | |
| 
 |