http_core.h revision 6db5333c9461942b8af724b101e687af541d4d4c
3802a3d3d7af51ddff31943d5514382f01265770Lennart Poettering/* ====================================================================
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * The Apache Software License, Version 1.1
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * Redistribution and use in source and binary forms, with or without
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * modification, are permitted provided that the following conditions
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * 1. Redistributions of source code must retain the above copyright
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * notice, this list of conditions and the following disclaimer.
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * 2. Redistributions in binary form must reproduce the above copyright
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * notice, this list of conditions and the following disclaimer in
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering * the documentation and/or other materials provided with the
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * distribution.
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * 3. The end-user documentation included with the redistribution,
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * if any, must include the following acknowledgment:
d3fae78fe86f1dfcdb07fd613ccbb3adf547a617Josh Triplett * "This product includes software developed by the
d3fae78fe86f1dfcdb07fd613ccbb3adf547a617Josh Triplett * Apache Software Foundation (http://www.apache.org/)."
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * Alternately, this acknowledgment may appear in the software itself,
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * if and wherever such third-party acknowledgments normally appear.
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * 4. The names "Apache" and "Apache Software Foundation" must
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * not be used to endorse or promote products derived from this
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * software without prior written permission. For written
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * permission, please contact apache@apache.org.
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * 5. Products derived from this software may not be called "Apache",
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * nor may "Apache" appear in their name, without prior written
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * permission of the Apache Software Foundation.
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * SUCH DAMAGE.
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * ====================================================================
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * This software consists of voluntary contributions made by many
db1413d7380acacc4e50faf801ca0d401da89764Kay Sievers * individuals on behalf of the Apache Software Foundation. For more
fc1a2e06a2eab6ca16664adb83b61fe958f00598Lennart Poettering * information on the Apache Software Foundation, please see
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * Portions of this software are based upon public domain software
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * originally written at the National Center for Supercomputing Applications,
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * University of Illinois, Urbana-Champaign.
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * @package CORE HTTP Daemon
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek/* ****************************************************************
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * The most basic server code is encapsulated in a single module
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * known as the core, which is just *barely* functional enough to
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * serve documents, though not terribly well.
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * Largely for NCSA back-compatibility reasons, the core needs to
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * make pieces of its config structures available to other modules.
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * The accessors are declared here, along with the interpretation
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * of one of them (allow_options).
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek#define OPT_ALL (OPT_INDEXES|OPT_INCLUDES|OPT_SYM_LINKS|OPT_EXECCGI)
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek/* options for get_remote_host() */
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek/* REMOTE_HOST returns the hostname, or NULL if the hostname
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * lookup fails. It will force a DNS lookup according to the
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * HostnameLookups setting.
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek/* REMOTE_NAME returns the hostname, or the dotted quad if the
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * hostname lookup fails. It will force a DNS lookup according
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * to the HostnameLookups setting.
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering/* REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * never forced.
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek/* REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * a double reverse lookup, regardless of the HostnameLookups
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * setting. The result is the (double reverse checked) hostname,
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * or NULL if any of the lookups fail.
a7a0912a36307567043e1939f6065ff54fa8fd66Zbigniew Jędrzejewski-Szmek/* Make sure we don't write less than 8192 bytes at any one time.
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmek#define AP_MIN_BYTES_TO_WRITE 8192
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmek * Retrieve the value of Options for this request
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmek * @param r The current request
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmek * @return the Options bitmask
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmek * @deffunc int ap_allow_options(request_rec *r)
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-SzmekAP_DECLARE(int) ap_allow_options(request_rec *r);
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmek * Retrieve the value of the AllowOverride for this request
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmek * @param r The current request
71418295125c542d3edd1e7251bb0701ef1af89bZbigniew Jędrzejewski-Szmek * @return the overrides bitmask
45df8656ebb1b0559a75993d1508fc61c2d39829Jan Engelhardt * @deffunc int ap_allow_overrides(request_rec *r)
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-SzmekAP_DECLARE(int) ap_allow_overrides(request_rec *r);
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * Retrieve the value of the DefaultType directive, or text/plain if not set
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * @param r The current request
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * @return The default type
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * @deffunc const char *ap_default_type(request_rec *r)
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-SzmekAP_DECLARE(const char *) ap_default_type(request_rec *r);
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * Retrieve the document root for this server
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * @param r The current request
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * @warning Don't use this! If your request went through a Userdir, or
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * something like that, it'll screw you. But it's back-compatible...
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * @return The document root
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * @deffunc const char *ap_document_root(request_rec *r)
9393a8774c1acd60deea40007061b9ffc783bf7eLennart PoetteringAP_DECLARE(const char *) ap_document_root(request_rec *r);
d4873485cf4fb223598f3b2fcf81e22cc8bb9456Ronny Chevalier * Lookup the remote client's DNS name or IP address
7284335adbb8cb2bc9c11f9e102906da1bf71145Zbigniew Jędrzejewski-Szmek * @param conn The current connection
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * @param dir_config The directory config vector from the request
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * @param type The type of lookup to perform. One of:
c91faef3b3facfdf13282aee957af25dd555890bLennart Poettering * REMOTE_HOST returns the hostname, or NULL if the hostname
* @deffunc const char *ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip)
AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip);
struct require_line {
char *requirement;
#ifdef CORE_PRIVATE
* the code that cares really is in http_core.c. Also, another accessor.
void **notes;
#define AP_NOTE_DIRECTORY_WALK 0
typedef unsigned char allow_options_t;
typedef unsigned char overrides_t;
typedef unsigned long etag_components_t;
#define ETAG_UNSET 0
/* path of the directory/regex/etc. see also d_is_fnmatch/absolute below */
unsigned d_components;
char *ap_default_type;
int satisfy;
char *ap_auth_type;
char *ap_auth_name;
char **response_code_strings;
#define HOSTNAME_LOOKUP_OFF 0
#define USE_CANONICAL_NAME_OFF (0)
#define ADD_DEFAULT_CHARSET_OFF (0)
const char *add_default_charset_name;
#ifdef RLIMIT_CPU
#ifdef RLIMIT_NPROC
int loglevel;
regex_t *r;
* What attributes/data should be included in ETag generation?
#ifdef GPROF
char *gprof_dir;
const char *ap_document_root;
char *access_name;
/* for http_config.c */
AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg);
* Runtime status/management
const char *s_value;
long i_value;
const char *description;
const char *name;
* This hook provdes a way for modules to provide metrics/statistics about
#ifdef __cplusplus