http_core.h revision 78b8e4dd910f03af0a602bc4b63ad7bc69868ee3
78N/A/* Licensed to the Apache Software Foundation (ASF) under one or more
78N/A * contributor license agreements. See the NOTICE file distributed with
78N/A * this work for additional information regarding copyright ownership.
78N/A * The ASF licenses this file to You under the Apache License, Version 2.0
78N/A * (the "License"); you may not use this file except in compliance with
78N/A * the License. You may obtain a copy of the License at
78N/A *
78N/A * http://www.apache.org/licenses/LICENSE-2.0
78N/A *
78N/A * Unless required by applicable law or agreed to in writing, software
78N/A * distributed under the License is distributed on an "AS IS" BASIS,
78N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
78N/A * See the License for the specific language governing permissions and
78N/A * limitations under the License.
78N/A */
78N/A
78N/A/**
78N/A * @file http_core.h
78N/A * @brief CORE HTTP Daemon
78N/A *
78N/A * @defgroup APACHE_CORE_HTTPD Core HTTP Daemon
78N/A * @ingroup APACHE_CORE
78N/A * @{
78N/A */
78N/A
78N/A#ifndef APACHE_HTTP_CORE_H
78N/A#define APACHE_HTTP_CORE_H
78N/A
78N/A#include "apr.h"
78N/A#include "apr_hash.h"
78N/A#include "apr_optional.h"
78N/A#include "util_filter.h"
78N/A#include "ap_expr.h"
78N/A
78N/A#include "http_config.h"
78N/A
78N/A#if APR_HAVE_STRUCT_RLIMIT
78N/A#include <sys/time.h>
78N/A#include <sys/resource.h>
78N/A#endif
78N/A
78N/A
78N/A#ifdef __cplusplus
78N/Aextern "C" {
78N/A#endif
78N/A
78N/A/* ****************************************************************
78N/A *
78N/A * The most basic server code is encapsulated in a single module
78N/A * known as the core, which is just *barely* functional enough to
78N/A * serve documents, though not terribly well.
78N/A *
78N/A * Largely for NCSA back-compatibility reasons, the core needs to
78N/A * make pieces of its config structures available to other modules.
78N/A * The accessors are declared here, along with the interpretation
78N/A * of one of them (allow_options).
78N/A */
78N/A
78N/A/**
78N/A * @defgroup APACHE_CORE_HTTPD_ACESSORS Acessors
78N/A *
78N/A * @brief File/Directory Accessor directives
78N/A *
78N/A * @{
78N/A */
78N/A
78N/A/** No directives */
78N/A#define OPT_NONE 0
78N/A/** Indexes directive */
78N/A#define OPT_INDEXES 1
78N/A/** SSI is enabled without exec= permission */
78N/A#define OPT_INCLUDES 2
78N/A/** FollowSymLinks directive */
78N/A#define OPT_SYM_LINKS 4
78N/A/** ExecCGI directive */
78N/A#define OPT_EXECCGI 8
78N/A/** directive unset */
78N/A#define OPT_UNSET 16
78N/A/** SSI exec= permission is permitted, iff OPT_INCLUDES is also set */
78N/A#define OPT_INC_WITH_EXEC 32
78N/A/** SymLinksIfOwnerMatch directive */
78N/A#define OPT_SYM_OWNER 64
78N/A/** MultiViews directive */
78N/A#define OPT_MULTI 128
78N/A/** All directives */
78N/A#define OPT_ALL (OPT_INDEXES|OPT_INCLUDES|OPT_INC_WITH_EXEC|OPT_SYM_LINKS|OPT_EXECCGI)
78N/A/** @} */
78N/A
78N/A/**
78N/A * @defgroup get_remote_host Remote Host Resolution
78N/A * @ingroup APACHE_CORE_HTTPD
78N/A * @{
78N/A */
78N/A/** REMOTE_HOST returns the hostname, or NULL if the hostname
78N/A * lookup fails. It will force a DNS lookup according to the
78N/A * HostnameLookups setting.
78N/A */
78N/A#define REMOTE_HOST (0)
78N/A
78N/A/** REMOTE_NAME returns the hostname, or the dotted quad if the
78N/A * hostname lookup fails. It will force a DNS lookup according
78N/A * to the HostnameLookups setting.
78N/A */
78N/A#define REMOTE_NAME (1)
78N/A
78N/A/** REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
78N/A * never forced.
78N/A */
78N/A#define REMOTE_NOLOOKUP (2)
78N/A
78N/A/** REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
78N/A * a double reverse lookup, regardless of the HostnameLookups
78N/A * setting. The result is the (double reverse checked) hostname,
78N/A * or NULL if any of the lookups fail.
78N/A */
78N/A#define REMOTE_DOUBLE_REV (3)
78N/A
78N/A/** @} // get_remote_host */
78N/A
78N/A/** all of the requirements must be met */
78N/A#define SATISFY_ALL 0
78N/A/** any of the requirements must be met */
78N/A#define SATISFY_ANY 1
78N/A/** There are no applicable satisfy lines */
78N/A#define SATISFY_NOSPEC 2
78N/A
78N/A/** Make sure we don't write less than 8000 bytes at any one time.
78N/A */
78N/A#define AP_MIN_BYTES_TO_WRITE 8000
78N/A
78N/A/** default maximum of internal redirects */
78N/A# define AP_DEFAULT_MAX_INTERNAL_REDIRECTS 10
78N/A
78N/A/** default maximum subrequest nesting level */
78N/A# define AP_DEFAULT_MAX_SUBREQ_DEPTH 10
78N/A
78N/A/**
78N/A * Retrieve the value of Options for this request
78N/A * @param r The current request
78N/A * @return the Options bitmask
78N/A */
78N/AAP_DECLARE(int) ap_allow_options(request_rec *r);
78N/A
78N/A/**
78N/A * Retrieve the value of the AllowOverride for this request
78N/A * @param r The current request
78N/A * @return the overrides bitmask
78N/A */
78N/AAP_DECLARE(int) ap_allow_overrides(request_rec *r);
78N/A
78N/A/**
78N/A * Retrieve the document root for this server
78N/A * @param r The current request
78N/A * @warning Don't use this! If your request went through a Userdir, or
78N/A * something like that, it'll screw you. But it's back-compatible...
78N/A * @return The document root
78N/A */
78N/AAP_DECLARE(const char *) ap_document_root(request_rec *r);
78N/A
78N/A/**
78N/A * Lookup the remote client's DNS name or IP address
78N/A * @ingroup get_remote_host
78N/A * @param conn The current connection
78N/A * @param dir_config The directory config vector from the request
78N/A * @param type The type of lookup to perform. One of:
78N/A * <pre>
78N/A * REMOTE_HOST returns the hostname, or NULL if the hostname
78N/A * lookup fails. It will force a DNS lookup according to the
78N/A * HostnameLookups setting.
78N/A * REMOTE_NAME returns the hostname, or the dotted quad if the
78N/A * hostname lookup fails. It will force a DNS lookup according
78N/A * to the HostnameLookups setting.
78N/A * REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
78N/A * never forced.
78N/A * REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
78N/A * a double reverse lookup, regardless of the HostnameLookups
78N/A * setting. The result is the (double reverse checked)
78N/A * hostname, or NULL if any of the lookups fail.
78N/A * </pre>
78N/A * @param str_is_ip unless NULL is passed, this will be set to non-zero on output when an IP address
78N/A * string is returned
78N/A * @return The remote hostname
78N/A */
78N/AAP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip);
78N/A
78N/A/**
78N/A * Retrieve the login name of the remote user. Undef if it could not be
78N/A * determined
78N/A * @param r The current request
78N/A * @return The user logged in to the client machine
78N/A */
78N/AAP_DECLARE(const char *) ap_get_remote_logname(request_rec *r);
78N/A
78N/A/* Used for constructing self-referencing URLs, and things like SERVER_PORT,
78N/A * and SERVER_NAME.
78N/A */
78N/A/**
78N/A * build a fully qualified URL from the uri and information in the request rec
78N/A * @param p The pool to allocate the URL from
78N/A * @param uri The path to the requested file
78N/A * @param r The current request
78N/A * @return A fully qualified URL
78N/A */
78N/AAP_DECLARE(char *) ap_construct_url(apr_pool_t *p, const char *uri, request_rec *r);
78N/A
78N/A/**
78N/A * Get the current server name from the request
78N/A * @param r The current request
78N/A * @return the server name
78N/A */
78N/AAP_DECLARE(const char *) ap_get_server_name(request_rec *r);
78N/A
78N/A/**
78N/A * Get the current server name from the request for the purposes
78N/A * of using in a URL. If the server name is an IPv6 literal
78N/A * address, it will be returned in URL format (e.g., "[fe80::1]").
78N/A * @param r The current request
78N/A * @return the server name
78N/A */
78N/AAP_DECLARE(const char *) ap_get_server_name_for_url(request_rec *r);
78N/A
78N/A/**
78N/A * Get the current server port
78N/A * @param r The current request
78N/A * @return The server's port
78N/A */
78N/AAP_DECLARE(apr_port_t) ap_get_server_port(const request_rec *r);
78N/A
78N/A/**
78N/A * Return the limit on bytes in request msg body
78N/A * @param r The current request
78N/A * @return the maximum number of bytes in the request msg body
78N/A */
78N/AAP_DECLARE(apr_off_t) ap_get_limit_req_body(const request_rec *r);
78N/A
78N/A/**
78N/A * Return the limit on bytes in XML request msg body
78N/A * @param r The current request
78N/A * @return the maximum number of bytes in XML request msg body
78N/A */
78N/AAP_DECLARE(size_t) ap_get_limit_xml_body(const request_rec *r);
78N/A
78N/A/**
78N/A * Install a custom response handler for a given status
78N/A * @param r The current request
78N/A * @param status The status for which the custom response should be used
78N/A * @param string The custom response. This can be a static string, a file
78N/A * or a URL
78N/A */
78N/AAP_DECLARE(void) ap_custom_response(request_rec *r, int status, const char *string);
78N/A
78N/A/**
78N/A * Check if the current request is beyond the configured max. number of redirects or subrequests
78N/A * @param r The current request
78N/A * @return true (is exceeded) or false
78N/A */
78N/AAP_DECLARE(int) ap_is_recursion_limit_exceeded(const request_rec *r);
78N/A
78N/A/**
78N/A * Check for a definition from the server command line
78N/A * @param name The define to check for
78N/A * @return 1 if defined, 0 otherwise
78N/A */
78N/AAP_DECLARE(int) ap_exists_config_define(const char *name);
78N/A/* FIXME! See STATUS about how */
78N/AAP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r);
78N/A
78N/A/* Authentication stuff. This is one of the places where compatibility
78N/A * with the old config files *really* hurts; they don't discriminate at
78N/A * all between different authentication schemes, meaning that we need
78N/A * to maintain common state for all of them in the core, and make it
78N/A * available to the other modules through interfaces.
78N/A */
78N/A
78N/A/** @see require_line */
78N/Atypedef struct require_line require_line;
78N/A
78N/A/**
78N/A * @brief A structure to keep track of authorization requirements
78N/A*/
78N/Astruct require_line {
78N/A /** Where the require line is in the config file. */
78N/A apr_int64_t method_mask;
78N/A /** The complete string from the command line */
78N/A char *requirement;
78N/A};
78N/A
78N/A/**
78N/A * Return the type of authorization required for this request
78N/A * @param r The current request
78N/A * @return The authorization required
78N/A */
78N/AAP_DECLARE(const char *) ap_auth_type(request_rec *r);
78N/A
78N/A/**
78N/A * Return the current Authorization realm
78N/A * @param r The current request
78N/A * @return The current authorization realm
78N/A */
78N/AAP_DECLARE(const char *) ap_auth_name(request_rec *r);
78N/A
78N/A/**
78N/A * How the requires lines must be met.
78N/A * @param r The current request
78N/A * @return How the requirements must be met. One of:
78N/A * <pre>
78N/A * SATISFY_ANY -- any of the requirements must be met.
78N/A * SATISFY_ALL -- all of the requirements must be met.
78N/A * SATISFY_NOSPEC -- There are no applicable satisfy lines
78N/A * </pre>
78N/A */
78N/AAP_DECLARE(int) ap_satisfies(request_rec *r);
78N/A
78N/A/**
78N/A * Core is also unlike other modules in being implemented in more than
78N/A * one file... so, data structures are declared here, even though most of
78N/A * the code that cares really is in http_core.c. Also, another accessor.
78N/A */
78N/AAP_DECLARE_DATA extern module core_module;
78N/A
78N/A/**
78N/A * @brief Per-request configuration
78N/A*/
78N/Atypedef struct {
78N/A /** bucket brigade used by getline for look-ahead and
78N/A * ap_get_client_block for holding left-over request body */
78N/A struct apr_bucket_brigade *bb;
78N/A
78N/A /** an array of per-request working data elements, accessed
78N/A * by ID using ap_get_request_note()
78N/A * (Use ap_register_request_note() during initialization
78N/A * to add elements)
78N/A */
78N/A void **notes;
78N/A
78N/A /** Custom response strings registered via ap_custom_response(),
78N/A * or NULL; check per-dir config if nothing found here
78N/A */
78N/A char **response_code_strings; /* from ap_custom_response(), not from
78N/A * ErrorDocument
78N/A */
78N/A
78N/A /** There is a script processor installed on the output filter chain,
78N/A * so it needs the default_handler to deliver a (script) file into
78N/A * the chain so it can process it. Normally, default_handler only
78N/A * serves files on a GET request (assuming the file is actual content),
78N/A * since other methods are not content-retrieval. This flag overrides
78N/A * that behavior, stating that the "content" is actually a script and
78N/A * won't actually be delivered as the response for the non-GET method.
78N/A */
78N/A int deliver_script;
78N/A
78N/A /** Should addition of charset= be suppressed for this request?
78N/A */
78N/A int suppress_charset;
78N/A} core_request_config;
78N/A
78N/A/* Standard entries that are guaranteed to be accessible via
78N/A * ap_get_request_note() for each request (additional entries
78N/A * can be added with ap_register_request_note())
78N/A */
78N/A#define AP_NOTE_DIRECTORY_WALK 0
78N/A#define AP_NOTE_LOCATION_WALK 1
78N/A#define AP_NOTE_FILE_WALK 2
78N/A#define AP_NUM_STD_NOTES 3
78N/A
78N/A/**
78N/A * Reserve an element in the core_request_config->notes array
78N/A * for some application-specific data
78N/A * @return An integer key that can be passed to ap_get_request_note()
78N/A * during request processing to access this element for the
78N/A * current request.
78N/A */
78N/AAP_DECLARE(apr_size_t) ap_register_request_note(void);
78N/A
78N/A/**
78N/A * Retrieve a pointer to an element in the core_request_config->notes array
78N/A * @param r The request
78N/A * @param note_num A key for the element: either a value obtained from
78N/A * ap_register_request_note() or one of the predefined AP_NOTE_*
78N/A * values.
78N/A * @return NULL if the note_num is invalid, otherwise a pointer to the
78N/A * requested note element.
78N/A * @remark At the start of a request, each note element is NULL. The
78N/A * handle provided by ap_get_request_note() is a pointer-to-pointer
78N/A * so that the caller can point the element to some app-specific
78N/A * data structure. The caller should guarantee that any such
78N/A * structure will last as long as the request itself.
78N/A */
78N/AAP_DECLARE(void **) ap_get_request_note(request_rec *r, apr_size_t note_num);
78N/A
78N/A
78N/Atypedef unsigned char allow_options_t;
78N/Atypedef unsigned char overrides_t;
78N/A
78N/A/*
78N/A * Bits of info that go into making an ETag for a file
78N/A * document. Why a long? Because char historically
78N/A * proved too short for Options, and int can be different
78N/A * sizes on different platforms.
78N/A */
78N/Atypedef unsigned long etag_components_t;
78N/A
78N/A#define ETAG_UNSET 0
78N/A#define ETAG_NONE (1 << 0)
78N/A#define ETAG_MTIME (1 << 1)
78N/A#define ETAG_INODE (1 << 2)
78N/A#define ETAG_SIZE (1 << 3)
78N/A#define ETAG_BACKWARD (ETAG_MTIME | ETAG_INODE | ETAG_SIZE)
78N/A#define ETAG_ALL (ETAG_MTIME | ETAG_INODE | ETAG_SIZE)
78N/A
78N/A/**
78N/A * @brief Server Signature Enumeration
78N/A */
78N/Atypedef enum {
78N/A srv_sig_unset,
78N/A srv_sig_off,
78N/A srv_sig_on,
78N/A srv_sig_withmail
78N/A} server_signature_e;
78N/A
78N/A/**
78N/A * @brief Per-directory configuration
78N/A */
78N/Atypedef struct {
78N/A /** path of the directory/regex/etc. see also d_is_fnmatch/absolute below */
78N/A char *d;
78N/A /** the number of slashes in d */
78N/A unsigned d_components;
78N/A
78N/A /** If (opts & OPT_UNSET) then no absolute assignment to options has
78N/A * been made.
78N/A * invariant: (opts_add & opts_remove) == 0
78N/A * Which said another way means that the last relative (options + or -)
78N/A * assignment made to each bit is recorded in exactly one of opts_add
78N/A * or opts_remove.
78N/A */
78N/A allow_options_t opts;
78N/A allow_options_t opts_add;
78N/A allow_options_t opts_remove;
78N/A overrides_t override;
78N/A allow_options_t override_opts;
78N/A
78N/A /* Custom response config. These can contain text or a URL to redirect to.
78N/A * if response_code_strings is NULL then there are none in the config,
78N/A * if it's not null then it's allocated to sizeof(char*)*RESPONSE_CODES.
78N/A * This lets us do quick merges in merge_core_dir_configs().
78N/A */
78N/A
78N/A char **response_code_strings; /* from ErrorDocument, not from
78N/A * ap_custom_response() */
78N/A
78N/A /* Hostname resolution etc */
78N/A#define HOSTNAME_LOOKUP_OFF 0
78N/A#define HOSTNAME_LOOKUP_ON 1
78N/A#define HOSTNAME_LOOKUP_DOUBLE 2
78N/A#define HOSTNAME_LOOKUP_UNSET 3
78N/A unsigned int hostname_lookups : 4;
78N/A
78N/A unsigned int content_md5 : 2; /* calculate Content-MD5? */
78N/A
78N/A#define USE_CANONICAL_NAME_OFF (0)
78N/A#define USE_CANONICAL_NAME_ON (1)
78N/A#define USE_CANONICAL_NAME_DNS (2)
78N/A#define USE_CANONICAL_NAME_UNSET (3)
78N/A unsigned use_canonical_name : 2;
78N/A
78N/A /* since is_fnmatch(conf->d) was being called so frequently in
78N/A * directory_walk() and its relatives, this field was created and
78N/A * is set to the result of that call.
78N/A */
78N/A unsigned d_is_fnmatch : 1;
78N/A
78N/A /* should we force a charset on any outgoing parameterless content-type?
78N/A * if so, which charset?
78N/A */
78N/A#define ADD_DEFAULT_CHARSET_OFF (0)
78N/A#define ADD_DEFAULT_CHARSET_ON (1)
78N/A#define ADD_DEFAULT_CHARSET_UNSET (2)
78N/A unsigned add_default_charset : 2;
78N/A const char *add_default_charset_name;
78N/A
78N/A /* System Resource Control */
78N/A#ifdef RLIMIT_CPU
78N/A struct rlimit *limit_cpu;
78N/A#endif
78N/A#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)
78N/A struct rlimit *limit_mem;
78N/A#endif
78N/A#ifdef RLIMIT_NPROC
78N/A struct rlimit *limit_nproc;
78N/A#endif
78N/A apr_off_t limit_req_body; /* limit on bytes in request msg body */
78N/A long limit_xml_body; /* limit on bytes in XML request msg body */
78N/A
78N/A /* logging options */
78N/A
78N/A server_signature_e server_signature;
78N/A
78N/A /* Access control */
78N/A apr_array_header_t *sec_file;
78N/A ap_regex_t *r;
78N/A
78N/A const char *mime_type; /* forced with ForceType */
78N/A const char *handler; /* forced with SetHandler */
78N/A const char *output_filters; /* forced with SetOutputFilters */
78N/A const char *input_filters; /* forced with SetInputFilters */
78N/A int accept_path_info; /* forced with AcceptPathInfo */
78N/A
78N/A apr_hash_t *ct_output_filters; /* added with AddOutputFilterByType */
78N/A
78N/A /*
78N/A * What attributes/data should be included in ETag generation?
78N/A */
78N/A etag_components_t etag_bits;
78N/A etag_components_t etag_add;
78N/A etag_components_t etag_remove;
78N/A
78N/A /*
78N/A * Run-time performance tuning
78N/A */
78N/A#define ENABLE_MMAP_OFF (0)
78N/A#define ENABLE_MMAP_ON (1)
78N/A#define ENABLE_MMAP_UNSET (2)
78N/A unsigned int enable_mmap : 2; /* whether files in this dir can be mmap'ed */
78N/A
78N/A#define ENABLE_SENDFILE_OFF (0)
78N/A#define ENABLE_SENDFILE_ON (1)
78N/A#define ENABLE_SENDFILE_UNSET (2)
78N/A unsigned int enable_sendfile : 2; /* files in this dir can be mmap'ed */
78N/A unsigned int allow_encoded_slashes : 1; /* URLs may contain %2f w/o being
78N/A * pitched indiscriminately */
78N/A
78N/A#define USE_CANONICAL_PHYS_PORT_OFF (0)
78N/A#define USE_CANONICAL_PHYS_PORT_ON (1)
78N/A#define USE_CANONICAL_PHYS_PORT_UNSET (2)
78N/A unsigned use_canonical_phys_port : 2;
78N/A
78N/A ap_parse_node_t *condition; /* Conditionally merge <If> sections */
78N/A
78N/A /** per-dir log config */
78N/A struct ap_logconf *log;
78N/A} core_dir_config;
78N/A
78N/A/* Per-server core configuration */
78N/A
78N/Atypedef struct {
78N/A
78N/A char *gprof_dir;
78N/A
78N/A /* Name translations --- we want the core to be able to do *something*
78N/A * so it's at least a minimally functional web server on its own (and
78N/A * can be tested that way). But let's keep it to the bare minimum:
78N/A */
78N/A const char *ap_document_root;
78N/A
78N/A /* Access control */
78N/A
78N/A char *access_name;
78N/A apr_array_header_t *sec_dir;
78N/A apr_array_header_t *sec_url;
78N/A
78N/A /* recursion backstopper */
78N/A int redirect_limit; /* maximum number of internal redirects */
78N/A int subreq_limit; /* maximum nesting level of subrequests */
78N/A
78N/A const char *protocol;
78N/A apr_table_t *accf_map;
78N/A
78N/A /* TRACE control */
78N/A#define AP_TRACE_UNSET -1
78N/A#define AP_TRACE_DISABLE 0
78N/A#define AP_TRACE_ENABLE 1
78N/A#define AP_TRACE_EXTENDED 2
78N/A int trace_enable;
78N/A
78N/A} core_server_config;
78N/A
78N/A/* for AddOutputFiltersByType in core.c */
78N/Avoid ap_add_output_filters_by_type(request_rec *r);
78N/A
78N/A/* for http_config.c */
78N/Avoid ap_core_reorder_directories(apr_pool_t *, server_rec *);
78N/A
78N/A/* for mod_perl */
78N/AAP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config);
78N/AAP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config);
78N/AAP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config);
78N/AAP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg);
78N/A
78N/A/* Core filters; not exported. */
78N/Aint ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
78N/A ap_input_mode_t mode, apr_read_type_e block,
78N/A apr_off_t readbytes);
78N/Aapr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *b);
78N/A
78N/A
78N/AAP_DECLARE(const char*) ap_get_server_protocol(server_rec* s);
78N/AAP_DECLARE(void) ap_set_server_protocol(server_rec* s, const char* proto);
78N/A
78N/A/* ----------------------------------------------------------------------
78N/A *
78N/A * Runtime status/management
78N/A */
78N/A
78N/Atypedef enum {
78N/A ap_mgmt_type_string,
78N/A ap_mgmt_type_long,
78N/A ap_mgmt_type_hash
78N/A} ap_mgmt_type_e;
78N/A
78N/Atypedef union {
78N/A const char *s_value;
78N/A long i_value;
78N/A apr_hash_t *h_value;
78N/A} ap_mgmt_value;
78N/A
78N/Atypedef struct {
78N/A const char *description;
78N/A const char *name;
78N/A ap_mgmt_type_e vtype;
78N/A ap_mgmt_value v;
78N/A} ap_mgmt_item_t;
78N/A
78N/A/* Handles for core filters */
78N/Aextern AP_DECLARE_DATA ap_filter_rec_t *ap_subreq_core_filter_handle;
78N/Aextern AP_DECLARE_DATA ap_filter_rec_t *ap_core_output_filter_handle;
78N/Aextern AP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle;
78N/Aextern AP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle;
78N/A
78N/A/**
78N/A * This hook provdes a way for modules to provide metrics/statistics about
78N/A * their operational status.
78N/A *
78N/A * @param p A pool to use to create entries in the hash table
78N/A * @param val The name of the parameter(s) that is wanted. This is
78N/A * tree-structured would be in the form ('*' is all the tree,
78N/A * 'module.*' all of the module , 'module.foo.*', or
78N/A * 'module.foo.bar' )
78N/A * @param ht The hash table to store the results. Keys are item names, and
78N/A * the values point to ap_mgmt_item_t structures.
78N/A * @ingroup hooks
78N/A */
78N/AAP_DECLARE_HOOK(int, get_mgmt_items,
78N/A (apr_pool_t *p, const char * val, apr_hash_t *ht))
78N/A
78N/A/* ---------------------------------------------------------------------- */
78N/A
78N/A/* ----------------------------------------------------------------------
78N/A *
78N/A * I/O logging with mod_logio
78N/A */
78N/A
78N/AAPR_DECLARE_OPTIONAL_FN(void, ap_logio_add_bytes_out,
78N/A (conn_rec *c, apr_off_t bytes));
78N/A
78N/AAPR_DECLARE_OPTIONAL_FN(void, ap_logio_add_bytes_in,
78N/A (conn_rec *c, apr_off_t bytes));
78N/A
78N/AAPR_DECLARE_OPTIONAL_FN(apr_off_t, ap_logio_get_last_bytes, (conn_rec *c));
78N/A
78N/A/* ----------------------------------------------------------------------
78N/A *
78N/A * ident lookups with mod_ident
78N/A */
78N/A
78N/AAPR_DECLARE_OPTIONAL_FN(const char *, ap_ident_lookup,
78N/A (request_rec *r));
78N/A
78N/A/* ----------------------------------------------------------------------
78N/A *
78N/A * authorization values with mod_authz_core
78N/A */
78N/A
78N/AAPR_DECLARE_OPTIONAL_FN(int, authz_some_auth_required, (request_rec *r));
78N/AAPR_DECLARE_OPTIONAL_FN(const char *, authn_ap_auth_type, (request_rec *r));
78N/AAPR_DECLARE_OPTIONAL_FN(const char *, authn_ap_auth_name, (request_rec *r));
78N/A
78N/A/* ----------------------------------------------------------------------
78N/A *
78N/A * authorization values with mod_access_compat
78N/A */
78N/A
78N/AAPR_DECLARE_OPTIONAL_FN(int, access_compat_ap_satisfies, (request_rec *r));
631N/A
631N/A/* ---------------------------------------------------------------------- */
631N/A
631N/A#ifdef __cplusplus
631N/A}
631N/A#endif
631N/A
631N/A#endif /* !APACHE_HTTP_CORE_H */
631N/A/** @} */
631N/A