home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / share / os2 / varios / apache / http_cor.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-06  |  6.0 KB  |  175 lines

  1.  
  2. /* ====================================================================
  3.  * Copyright (c) 1995 The Apache Group.  All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * 1. Redistributions of source code must retain the above copyright
  10.  *    notice, this list of conditions and the following disclaimer. 
  11.  *
  12.  * 2. Redistributions in binary form must reproduce the above copyright
  13.  *    notice, this list of conditions and the following disclaimer in
  14.  *    the documentation and/or other materials provided with the
  15.  *    distribution.
  16.  *
  17.  * 3. All advertising materials mentioning features or use of this
  18.  *    software must display the following acknowledgment:
  19.  *    "This product includes software developed by the Apache Group
  20.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  21.  *
  22.  * 4. The names "Apache Server" and "Apache Group" must not be used to
  23.  *    endorse or promote products derived from this software without
  24.  *    prior written permission.
  25.  *
  26.  * 5. Redistributions of any form whatsoever must retain the following
  27.  *    acknowledgment:
  28.  *    "This product includes software developed by the Apache Group
  29.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  30.  *
  31.  * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  32.  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  33.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  34.  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  35.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  36.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  37.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  38.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  39.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  40.  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  41.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  42.  * OF THE POSSIBILITY OF SUCH DAMAGE.
  43.  * ====================================================================
  44.  *
  45.  * This software consists of voluntary contributions made by many
  46.  * individuals on behalf of the Apache Group and was originally based
  47.  * on public domain software written at the National Center for
  48.  * Supercomputing Applications, University of Illinois, Urbana-Champaign.
  49.  * For more information on the Apache Group and the Apache HTTP server
  50.  * project, please see <http://www.apache.org/>.
  51.  *
  52.  */
  53.  
  54.  
  55. /*****************************************************************
  56.  *
  57.  * The most basic server code is encapsulated in a single module
  58.  * known as the core, which is just *barely* functional enough to
  59.  * serve documents, though not terribly well.
  60.  *
  61.  * Largely for NCSA back-compatibility reasons, the core needs to
  62.  * make pieces of its config structures available to other modules.
  63.  * The accessors are declared here, along with the interpretation
  64.  * of one of them (allow_options).
  65.  */
  66.  
  67. #define OPT_NONE 0
  68. #define OPT_INDEXES 1
  69. #define OPT_INCLUDES 2
  70. #define OPT_SYM_LINKS 4
  71. #define OPT_EXECCGI 8
  72. #define OPT_UNSET 16
  73. #define OPT_INCNOEXEC 32
  74. #define OPT_SYM_OWNER 64
  75. #define OPT_MULTI 128
  76. #define OPT_ALL (OPT_INDEXES|OPT_INCLUDES|OPT_SYM_LINKS|OPT_EXECCGI)
  77.  
  78. /* options for get_remote_host() */
  79. #define REMOTE_HOST (0)
  80. #define REMOTE_NAME (1)
  81.  
  82. int allow_options (request_rec *);
  83. int allow_overrides (request_rec *);
  84. char *default_type (request_rec *);     
  85. char *document_root (request_rec *); /* Don't use this!  If your request went
  86.                       * through a Userdir, or something like
  87.                       * that, it'll screw you.  But it's
  88.                       * back-compatible...
  89.                       */
  90. extern const char *get_remote_host(conn_rec *conn, void *dir_config, int type);
  91. extern const char *get_remote_logname(request_rec *r);
  92.      
  93. /* Authentication stuff.  This is one of the places where compatibility
  94.  * with the old config files *really* hurts; they don't discriminate at
  95.  * all between different authentication schemes, meaning that we need
  96.  * to maintain common state for all of them in the core, and make it
  97.  * available to the other modules through interfaces.
  98.  */
  99.     
  100. typedef struct {
  101.     int method_mask;
  102.     char *requirement;
  103. } require_line;
  104.      
  105. char *auth_type (request_rec *);
  106. char *auth_name (request_rec *);     
  107. array_header *requires (request_rec *);    
  108.  
  109. #ifdef CORE_PRIVATE
  110.  
  111. /*
  112.  * Core is also unlike other modules in being implemented in more than
  113.  * one file... so, data structures are declared here, even though most of
  114.  * the code that cares really is in http_core.c.  Also, anothre accessor.
  115.  */
  116.  
  117. char *response_code_string (request_rec *r, int error_index);
  118.  
  119. extern module core_module;
  120.  
  121. /* Per-directory configuration */
  122.  
  123. typedef char allow_options_t;
  124. typedef char overrides_t;
  125.  
  126. typedef struct {
  127.     char *d;
  128.     allow_options_t opts;
  129.     overrides_t override;
  130.     
  131.     /* MIME typing --- the core doesn't do anything at all with this,
  132.      * but it does know what to slap on a request for a document which
  133.      * goes untyped by other mechanisms before it slips out the door...
  134.      */
  135.     
  136.     char *default_type;
  137.   
  138.     /* Authentication stuff.  Groan... */
  139.     
  140.     char *auth_type;
  141.     char *auth_name;
  142.     array_header *requires;
  143.  
  144.     int content_md5;
  145.     
  146.     /* Custom response config. These can contain text or a URL to redirect to.
  147.      */
  148.   
  149.     char *response_code_strings[RESPONSE_CODES+1];
  150.  
  151.     /* Hostname resolution etc */
  152.     int hostname_lookups;
  153.     int do_rfc1413;   /* See if client is advertising a username? */
  154.  
  155. } core_dir_config;
  156.  
  157. /* Per-server core configuration */
  158.  
  159. typedef struct {
  160.   
  161.     /* Name translations --- we want the core to be able to do *something*
  162.      * so it's at least a minimally functional web server on its own (and
  163.      * can be tested that way).  But let's keep it to the bare minimum:
  164.      */
  165.     char *document_root;
  166.   
  167.     /* Access control */
  168.   
  169.     char *access_name;
  170.     array_header *sec;
  171.     array_header *sec_url;
  172. } core_server_config;
  173.  
  174. #endif
  175.