http_core.h revision 943016cae7a40f689cc0b65fd8cf8d4250a21352
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/* Licensed to the Apache Software Foundation (ASF) under one or more
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * contributor license agreements. See the NOTICE file distributed with
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * this work for additional information regarding copyright ownership.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * The ASF licenses this file to You under the Apache License, Version 2.0
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * (the "License"); you may not use this file except in compliance with
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * the License. You may obtain a copy of the License at
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * Unless required by applicable law or agreed to in writing, software
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * distributed under the License is distributed on an "AS IS" BASIS,
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * See the License for the specific language governing permissions and
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * limitations under the License.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @brief CORE HTTP Daemon
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @defgroup APACHE_CORE_HTTPD Core HTTP Daemon
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @ingroup APACHE_CORE
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/* ****************************************************************
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * The most basic server code is encapsulated in a single module
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * known as the core, which is just *barely* functional enough to
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * serve documents, though not terribly well.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * Largely for NCSA back-compatibility reasons, the core needs to
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * make pieces of its config structures available to other modules.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * The accessors are declared here, along with the interpretation
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * of one of them (allow_options).
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @defgroup APACHE_CORE_HTTPD_ACESSORS Acessors
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @brief File/Directory Accessor directives
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** No directives */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** Indexes directive */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** SSI is enabled without exec= permission */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** FollowSymLinks directive */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** ExecCGI directive */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** directive unset */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** SSI exec= permission is permitted, iff OPT_INCLUDES is also set */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** SymLinksIfOwnerMatch directive */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** MultiViews directive */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** All directives */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose#define OPT_ALL (OPT_INDEXES|OPT_INCLUDES|OPT_INC_WITH_EXEC|OPT_SYM_LINKS|OPT_EXECCGI)
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @defgroup get_remote_host Remote Host Resolution
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @ingroup APACHE_CORE_HTTPD
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** REMOTE_HOST returns the hostname, or NULL if the hostname
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * lookup fails. It will force a DNS lookup according to the
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * HostnameLookups setting.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** REMOTE_NAME returns the hostname, or the dotted quad if the
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * hostname lookup fails. It will force a DNS lookup according
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * to the HostnameLookups setting.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * never forced.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * a double reverse lookup, regardless of the HostnameLookups
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * setting. The result is the (double reverse checked) hostname,
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * or NULL if any of the lookups fail.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** @} // get_remote_host */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** all of the requirements must be met */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** any of the requirements must be met */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** There are no applicable satisfy lines */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** Make sure we don't write less than 8000 bytes at any one time.
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** default maximum of internal redirects */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose/** default maximum subrequest nesting level */
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * Retrieve the value of Options for this request
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @param r The current request
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @return the Options bitmask
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * Retrieve the value of the AllowOverride for this request
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @param r The current request
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @return the overrides bitmask
a0ab15ceb80290db80c2052520830a95390de385Sumit BoseAP_DECLARE(int) ap_allow_overrides(request_rec *r);
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * Retrieve the document root for this server
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @param r The current request
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @warning Don't use this! If your request went through a Userdir, or
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * something like that, it'll screw you. But it's back-compatible...
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @return The document root
a0ab15ceb80290db80c2052520830a95390de385Sumit BoseAP_DECLARE(const char *) ap_document_root(request_rec *r);
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * Lookup the remote client's DNS name or IP address
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @ingroup get_remote_host
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @param conn The current connection
a0ab15ceb80290db80c2052520830a95390de385Sumit Bose * @param dir_config The directory config vector from the request
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;
* the code that cares really is in http_core.c. Also, another accessor.
#ifndef AP_DEBUG
#define AP_CORE_MODULE_INDEX 0
#define ap_get_core_module_config(v) \
(((void **)(v))[AP_CORE_MODULE_INDEX])
void **notes;
const char *document_root;
const char *context_document_root;
const char *context_prefix;
int deliver_script;
int suppress_charset;
#define AP_NOTE_DIRECTORY_WALK 0
typedef unsigned char allow_options_t;
typedef unsigned int 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;
#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
ap_regex_t *r;
* What attributes/data should be included in ETag generation?
#define ENABLE_MMAP_OFF (0)
#define ENABLE_SENDFILE_OFF (0)
#define USE_CANONICAL_PHYS_PORT_OFF (0)
#define AP_MAXRANGES_NORANGES 0
int max_ranges;
int max_overlaps;
int max_reversals;
#define AP_SENDFILE_ENABLED(x) \
char *gprof_dir;
const char *ap_document_root;
char *access_name;
const char *protocol;
* logged to the error log once per connection/request
#define AP_TRACE_DISABLE 0
int trace_enable;
#define AP_HTTP09_UNSET 0
char http09_enable;
#define AP_HTTP_CONFORMANCE_UNSET 0
char http_conformance;
#define AP_HTTP_CL_HEAD_ZERO_UNSET 0
int http_cl_head_zero;
#define AP_HTTP_EXPECT_STRICT_UNSET 0
int http_expect_strict;
/* for AddOutputFiltersByType in core.c */
/* for http_config.c */
AP_CORE_DECLARE(const char *) ap_add_if_conf(apr_pool_t *p, core_dir_config *conf, void *url_config);
AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg);
typedef struct core_net_rec {
conn_rec *c;
} core_net_rec;
* 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
typedef struct ap_errorlog_info {
const server_rec *s;
const conn_rec *c;
const request_rec *r;
const char *file;
int line;
int module_index;
int level;
int using_provider;
int startup;
const char *format;
struct ap_errorlog_provider {
unsigned int flags;
int flags);
typedef struct ap_errorlog_handler {
const char *arg;
unsigned int flags;
unsigned int min_loglevel;
const char *errstr))
(request_rec *r));
#define AP_SQ_MAIN_STATE 0
#ifdef __cplusplus