http_core.h revision d0d4515ee39dfff34bae489b5390af964c5d4cfc
2N/A/* ==================================================================== 2N/A * The Apache Software License, Version 1.1 2N/A * Copyright (c) 2000 The Apache Software Foundation. All rights 2N/A * Redistribution and use in source and binary forms, with or without 2N/A * modification, are permitted provided that the following conditions 2N/A * 1. Redistributions of source code must retain the above copyright 2N/A * notice, this list of conditions and the following disclaimer. 2N/A * 2. Redistributions in binary form must reproduce the above copyright 2N/A * notice, this list of conditions and the following disclaimer in 2N/A * the documentation and/or other materials provided with the 2N/A * 3. The end-user documentation included with the redistribution, 2N/A * if any, must include the following acknowledgment: 2515N/A * "This product includes software developed by the 2N/A * Alternately, this acknowledgment may appear in the software itself, 2N/A * if and wherever such third-party acknowledgments normally appear. 2N/A * 4. The names "Apache" and "Apache Software Foundation" must 2N/A * not be used to endorse or promote products derived from this 2N/A * software without prior written permission. For written 2N/A * permission, please contact apache@apache.org. 2N/A * 5. Products derived from this software may not be called "Apache", 59N/A * nor may "Apache" appear in their name, without prior written 59N/A * permission of the Apache Software Foundation. 2N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 2N/A * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2N/A * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26N/A * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 26N/A * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2N/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26N/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1470N/A * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 38N/A * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1470N/A * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1470N/A * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 181N/A * ==================================================================== 26N/A * This software consists of voluntary contributions made by many 26N/A * individuals on behalf of the Apache Software Foundation. For more 26N/A * information on the Apache Software Foundation, please see 26N/A * Portions of this software are based upon public domain software 26N/A * originally written at the National Center for Supercomputing Applications, 700N/A * University of Illinois, Urbana-Champaign. 26N/A * @package CORE HTTP Daemon 26N/A/* **************************************************************** 2N/A * The most basic server code is encapsulated in a single module 26N/A * known as the core, which is just *barely* functional enough to 26N/A * serve documents, though not terribly well. 26N/A * Largely for NCSA back-compatibility reasons, the core needs to 883N/A * make pieces of its config structures available to other modules. 26N/A * The accessors are declared here, along with the interpretation 26N/A * of one of them (allow_options). 2236N/A/* options for get_remote_host() */ 2N/A/* REMOTE_HOST returns the hostname, or NULL if the hostname 26N/A * lookup fails. It will force a DNS lookup according to the 26N/A * HostnameLookups setting. 99N/A/* REMOTE_NAME returns the hostname, or the dotted quad if the 59N/A * hostname lookup fails. It will force a DNS lookup according 12N/A * to the HostnameLookups setting. 1256N/A/* REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is 1256N/A/* REMOTE_DOUBLE_REV will always force a DNS lookup, and also force 1256N/A * a double reverse lookup, regardless of the HostnameLookups 1256N/A * setting. The result is the (double reverse checked) hostname, 1256N/A * or NULL if any of the lookups fail. 1256N/A * Retrieve the value of Options for this request 1256N/A * @param r The current request 1256N/A * @return the Options bitmask 1256N/A * @deffunc int ap_allow_options(request_rec *r) 26N/A * Retrieve the value of the AllowOverride for this request 26N/A * @param r The current request 1256N/A * @return the overrides bitmask 2N/A * @deffunc int ap_allow_overrides(request_rec *r) 185N/A * Retrieve the value of the DefaultType directive, or text/plain if not set 2N/A * @param r The current request 255N/A * @return The default type 145N/A * @deffunc const char *ap_default_type(request_rec *r) 38N/A * Retrieve the document root for this server 26N/A * @param r The current request 197N/A * @warning Don't use this! If your request went through a Userdir, or 197N/A * something like that, it'll screw you. But it's back-compatible... 197N/A * @return The document root 197N/A * @deffunc const char *ap_document_root(request_rec *r) 26N/A * Lookup the remote client's DNS name or IP address 46N/A * @param conn The current connection 46N/A * @param dir_config The directory config vector from the request 46N/A * @param type The type of lookup to perform. One of: 64N/A * REMOTE_HOST returns the hostname, or NULL if the hostname 26N/A * lookup fails. It will force a DNS lookup according to the 46N/A * HostnameLookups setting. 46N/A * REMOTE_NAME returns the hostname, or the dotted quad if the 46N/A * hostname lookup fails. It will force a DNS lookup according 2N/A * to the HostnameLookups setting. 1256N/A * REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is 1256N/A * REMOTE_DOUBLE_REV will always force a DNS lookup, and also force 1256N/A * a double reverse lookup, regardless of the HostnameLookups 1256N/A * setting. The result is the (double reverse checked) 1256N/A * hostname, or NULL if any of the lookups fail. 1256N/A * @return The remote hostname 1256N/A * @deffunc const char *ap_get_remote_host(conn_rec *conn, void *dir_config, int type) 2236N/A * Retrieve the login name of the remote user. Undef if it could not be 1256N/A * @param r The current request 1256N/A * @return The user logged in to the client machine 1256N/A * @deffunc const char *ap_get_remote_logname(request_rec *r) 1256N/A/* Used for constructing self-referencing URLs, and things like SERVER_PORT, 1256N/A * build a fully qualified URL from the uri and information in the request rec 1256N/A * @param p The pool to allocate the URL from 1256N/A * @param uri The path to the requested file 1256N/A * @param r The current request 1256N/A * @return A fully qualified URL 1934N/A * @deffunc char *ap_construct_url(apr_pool_t *p, const char *uri, request_rec *r) 1256N/A * Get the current server name from the request 1413N/A * @param r The current request 1413N/A * @deffunc const char *ap_get_server_name(request_rec *r) 1413N/A * Get the current server port 1413N/A * @param The current request 1413N/A * @return The server's port 1256N/A * @deffunc unsigned ap_get_server_port(const request_rec *r) 1934N/A * Return the limit on bytes in request msg body 1256N/A * @param r The current request 1256N/A * @return the maximum number of bytes in the request msg body 1256N/A * @deffunc unsigned long ap_get_limit_req_body(const request_rec *r) 1934N/A * Return the limit on bytes in XML request msg body 1256N/A * @param r The current request 1256N/A * @return the maximum number of bytes in XML request msg body 1256N/A * @deffunc size_t ap_get_limit_xml_body(const request_rec *r) 1256N/A * Install a custom response handler for a given status 1256N/A * @param r The current request 1256N/A * @param status The status for which the custom response should be used 1256N/A * @param string The custom response. This can be a static string, a file 53N/A * @deffunc void ap_custom_response(request_rec *r, int status, char *string) 181N/A * Check for a definition from the server command line 369N/A * @param name The define to check for 181N/A * @return 1 if defined, 0 otherwise 181N/A * @deffunc int ap_exists_config_define(const char *name) 181N/A/* FIXME! See STATUS about how */ 99N/A/* Authentication stuff. This is one of the places where compatibility 181N/A * with the old config files *really* hurts; they don't discriminate at 99N/A * all between different authentication schemes, meaning that we need 26N/A * to maintain common state for all of them in the core, and make it 1549N/A * available to the other modules through interfaces. 1929N/A/** A structure to keep track of authorization requirements */ 1929N/A /** Where the require line is in the config file. */ 1929N/A /** The complete string from the command line */ 1549N/A * Return the type of authorization required for this request 1549N/A * @param r The current request 1555N/A * @return The authorization required 1549N/A * @deffunc const char *ap_auth_type(request_rec *r) 1555N/A * Return the current Authorization realm 1549N/A * @param r The current request 1549N/A * @return The current authorization realm 1549N/A * @deffunc const char *ap_auth_name(request_rec *r) 1549N/A * How the requires lines must be met. 185N/A * @param r The current request 185N/A * @return How the requirements must be met. One of: 1929N/A * SATISFY_ANY -- any of the requirements must be met. 1929N/A * SATISFY_ALL -- all of the requirements must be met. 1549N/A * SATISFY_NOSPEC -- There are no applicable satisfy lines 145N/A * @deffunc int ap_satisfies(request_rec *r) 117N/A * Retrieve information about all of the requires directives for this request 2515N/A * @param r The current request 84N/A * @return An array of all requires directives for this request 145N/A * @deffunc const apr_array_header_t *ap_requires(request_rec *r) 2515N/A * CGI Script stuff for Win32... 46N/A * Core is also unlike other modules in being implemented in more than 2N/A * one file... so, data structures are declared here, even though most of 1256N/A/* Per-directory configuration */ 32N/A /* the number of slashes in d */ 1256N/A /* If (opts & OPT_UNSET) then no absolute assignment to options has 38N/A * invariant: (opts_add & opts_remove) == 0 38N/A * Which said another way means that the last relative (options + or -) 38N/A * assignment made to each bit is recorded in exactly one of opts_add 26N/A /* MIME typing --- the core doesn't do anything at all with this, 26N/A * but it does know what to slap on a request for a document which 26N/A * goes untyped by other mechanisms before it slips out the door... 26N/A /* Authentication stuff. Groan... */ 32N/A /* Custom response config. These can contain text or a URL to redirect to. 32N/A * if response_code_strings is NULL then there are none in the config, 38N/A * if it's not null then it's allocated to sizeof(char*)*RESPONSE_CODES. 38N/A * This lets us do quick merges in merge_core_dir_configs(). /* Hostname resolution etc */ signed int do_rfc1413 :
2;
/* See if client is advertising a username? */ signed int content_md5 :
2;
/* calculate Content-MD5? */ /* since is_fnmatch(conf->d) was being called so frequently in * directory_walk() and its relatives, this field was created and * is set to the result of that call. /* should we force a charset on any outgoing parameterless content-type? /* System Resource Control */ unsigned long limit_req_body;
/* limit on bytes in request msg body */ /* Where to find interpreter to run scripts */ /* bucket brigade held by ap_get_client_block() between calls */ /* Per-server core configuration */ /* Name translations --- we want the core to be able to do *something* * so it's at least a minimally functional web server on its own (and * can be tested that way). But let's keep it to the bare minimum: #
endif /* !APACHE_HTTP_CORE_H */