home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / apache_1.0.5 / src / http_core.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-16  |  5.6 KB  |  161 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. int allow_options (request_rec *);
  79. int allow_overrides (request_rec *);
  80. char *default_type (request_rec *);     
  81. char *document_root (request_rec *); /* Don't use this!  If your request went
  82.                       * through a Userdir, or something like
  83.                       * that, it'll screw you.  But it's
  84.                       * back-compatible...
  85.                       */
  86.      
  87. /* Authentication stuff.  This is one of the places where compatibility
  88.  * with the old config files *really* hurts; they don't discriminate at
  89.  * all between different authentication schemes, meaning that we need
  90.  * to maintain common state for all of them in the core, and make it
  91.  * available to the other modules through interfaces.
  92.  */
  93.     
  94. typedef struct {
  95.     int method_mask;
  96.     char *requirement;
  97. } require_line;
  98.      
  99. char *auth_type (request_rec *);
  100. char *auth_name (request_rec *);     
  101. array_header *requires (request_rec *);    
  102.  
  103. #ifdef CORE_PRIVATE
  104.  
  105. /*
  106.  * Core is also unlike other modules in being implemented in more than
  107.  * one file... so, data structures are declared here, even though most of
  108.  * the code that cares really is in http_core.c.  Also, anothre accessor.
  109.  */
  110.  
  111. char *response_code_string (request_rec *r, int error_index);
  112.  
  113. extern module core_module;
  114.  
  115. /* Per-directory configuration */
  116.  
  117. typedef char allow_options_t;
  118. typedef char overrides_t;
  119.  
  120. typedef struct {
  121.     char *d;
  122.     allow_options_t opts;
  123.     overrides_t override;
  124.     
  125.     /* MIME typing --- the core doesn't do anything at all with this,
  126.      * but it does know what to slap on a request for a document which
  127.      * goes untyped by other mechanisms before it slips out the door...
  128.      */
  129.     
  130.     char *default_type;
  131.   
  132.     /* Authentication stuff.  Groan... */
  133.     
  134.     char *auth_type;
  135.     char *auth_name;
  136.     array_header *requires;
  137.     
  138.     /* Custom response config. These can contain text or a URL to redirect to.
  139.      */
  140.   
  141.     char *response_code_strings[RESPONSE_CODES+1];
  142. } core_dir_config;
  143.  
  144. /* Per-server core configuration */
  145.  
  146. typedef struct {
  147.   
  148.     /* Name translations --- we want the core to be able to do *something*
  149.      * so it's at least a minimally functional web server on its own (and
  150.      * can be tested that way).  But let's keep it to the bare minimum:
  151.      */
  152.     char *document_root;
  153.   
  154.     /* Access control */
  155.   
  156.     char *access_name;
  157.     array_header *sec;
  158. } core_server_config;
  159.  
  160. #endif
  161.