Blame include/http_request.h

Packit 90a5c9
/* Licensed to the Apache Software Foundation (ASF) under one or more
Packit 90a5c9
 * contributor license agreements.  See the NOTICE file distributed with
Packit 90a5c9
 * this work for additional information regarding copyright ownership.
Packit 90a5c9
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 90a5c9
 * (the "License"); you may not use this file except in compliance with
Packit 90a5c9
 * the License.  You may obtain a copy of the License at
Packit 90a5c9
 *
Packit 90a5c9
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 90a5c9
 *
Packit 90a5c9
 * Unless required by applicable law or agreed to in writing, software
Packit 90a5c9
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 90a5c9
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 90a5c9
 * See the License for the specific language governing permissions and
Packit 90a5c9
 * limitations under the License.
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @file http_request.h
Packit 90a5c9
 * @brief Apache Request library
Packit 90a5c9
 *
Packit 90a5c9
 * @defgroup APACHE_CORE_REQ Apache Request Processing
Packit 90a5c9
 * @ingroup  APACHE_CORE
Packit 90a5c9
 * @{
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/*
Packit 90a5c9
 * request.c is the code which handles the main line of request
Packit 90a5c9
 * processing, once a request has been read in (finding the right per-
Packit 90a5c9
 * directory configuration, building it if necessary, and calling all
Packit 90a5c9
 * the module dispatch functions in the right order).
Packit 90a5c9
 *
Packit 90a5c9
 * The pieces here which are public to the modules, allow them to learn
Packit 90a5c9
 * how the server would handle some other file or URI, or perhaps even
Packit 90a5c9
 * direct the server to serve that other file instead of the one the
Packit 90a5c9
 * client requested directly.
Packit 90a5c9
 *
Packit 90a5c9
 * There are two ways to do that.  The first is the sub_request mechanism,
Packit 90a5c9
 * which handles looking up files and URIs as adjuncts to some other
Packit 90a5c9
 * request (e.g., directory entries for multiviews and directory listings);
Packit 90a5c9
 * the lookup functions stop short of actually running the request, but
Packit 90a5c9
 * (e.g., for includes), a module may call for the request to be run
Packit 90a5c9
 * by calling run_sub_req.  The space allocated to create sub_reqs can be
Packit 90a5c9
 * reclaimed by calling destroy_sub_req --- be sure to copy anything you care
Packit 90a5c9
 * about which was allocated in its apr_pool_t elsewhere before doing this.
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
#ifndef APACHE_HTTP_REQUEST_H
Packit 90a5c9
#define APACHE_HTTP_REQUEST_H
Packit 90a5c9
Packit 90a5c9
#include "apr_optional.h"
Packit 90a5c9
#include "util_filter.h"
Packit 90a5c9
Packit 90a5c9
#ifdef __cplusplus
Packit 90a5c9
extern "C" {
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
#define AP_SUBREQ_NO_ARGS 0
Packit 90a5c9
#define AP_SUBREQ_MERGE_ARGS 1
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * An internal handler used by the ap_process_request, all subrequest mechanisms
Packit 90a5c9
 * and the redirect mechanism.
Packit 90a5c9
 * @param r The request, subrequest or internal redirect to pre-process
Packit 90a5c9
 * @return The return code for the request
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_process_request_internal(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Create a subrequest from the given URI.  This subrequest can be
Packit 90a5c9
 * inspected to find information about the requested URI
Packit 90a5c9
 * @param new_uri The URI to lookup
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @param next_filter The first filter the sub_request should use.  If this is
Packit 90a5c9
 *                    NULL, it defaults to the first filter for the main request
Packit 90a5c9
 * @return The new request record
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(request_rec *) ap_sub_req_lookup_uri(const char *new_uri,
Packit 90a5c9
                                                const request_rec *r,
Packit 90a5c9
                                                ap_filter_t *next_filter);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Create a subrequest for the given file.  This subrequest can be
Packit 90a5c9
 * inspected to find information about the requested file
Packit 90a5c9
 * @param new_file The file to lookup
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @param next_filter The first filter the sub_request should use.  If this is
Packit 90a5c9
 *                    NULL, it defaults to the first filter for the main request
Packit 90a5c9
 * @return The new request record
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
Packit 90a5c9
                                              const request_rec *r,
Packit 90a5c9
                                              ap_filter_t *next_filter);
Packit 90a5c9
/**
Packit 90a5c9
 * Create a subrequest for the given apr_dir_read result.  This subrequest
Packit 90a5c9
 * can be inspected to find information about the requested file
Packit 90a5c9
 * @param finfo The apr_dir_read result to lookup
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @param subtype What type of subrequest to perform, one of;
Packit 90a5c9
 * 
Packit 90a5c9
 *      AP_SUBREQ_NO_ARGS     ignore r->args and r->path_info
Packit 90a5c9
 *      AP_SUBREQ_MERGE_ARGS  merge r->args and r->path_info
Packit 90a5c9
 * 
Packit 90a5c9
 * @param next_filter The first filter the sub_request should use.  If this is
Packit 90a5c9
 *                    NULL, it defaults to the first filter for the main request
Packit 90a5c9
 * @return The new request record
Packit 90a5c9
 * @note The apr_dir_read flags value APR_FINFO_MIN|APR_FINFO_NAME flag is the
Packit 90a5c9
 * minimum recommended query if the results will be passed to apr_dir_read.
Packit 90a5c9
 * The file info passed must include the name, and must have the same relative
Packit 90a5c9
 * directory as the current request.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *finfo,
Packit 90a5c9
                                                   const request_rec *r,
Packit 90a5c9
                                                   int subtype,
Packit 90a5c9
                                                   ap_filter_t *next_filter);
Packit 90a5c9
/**
Packit 90a5c9
 * Create a subrequest for the given URI using a specific method.  This
Packit 90a5c9
 * subrequest can be inspected to find information about the requested URI
Packit 90a5c9
 * @param method The method to use in the new subrequest
Packit 90a5c9
 * @param new_uri The URI to lookup
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @param next_filter The first filter the sub_request should use.  If this is
Packit 90a5c9
 *                    NULL, it defaults to the first filter for the main request
Packit 90a5c9
 * @return The new request record
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method,
Packit 90a5c9
                                                const char *new_uri,
Packit 90a5c9
                                                const request_rec *r,
Packit 90a5c9
                                                ap_filter_t *next_filter);
Packit 90a5c9
/**
Packit 90a5c9
 * An output filter to strip EOS buckets from sub-requests.  This always
Packit 90a5c9
 * has to be inserted at the end of a sub-requests filter stack.
Packit 90a5c9
 * @param f The current filter
Packit 90a5c9
 * @param bb The brigade to filter
Packit 90a5c9
 * @return status code
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f,
Packit 90a5c9
                                                        apr_bucket_brigade *bb);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the handler for the subrequest
Packit 90a5c9
 * @param r The subrequest to run
Packit 90a5c9
 * @return The return code for the subrequest
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_run_sub_req(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Free the memory associated with a subrequest
Packit 90a5c9
 * @param r The subrequest to finish
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_destroy_sub_req(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/*
Packit 90a5c9
 * Then there's the case that you want some other request to be served
Packit 90a5c9
 * as the top-level request INSTEAD of what the client requested directly.
Packit 90a5c9
 * If so, call this from a handler, and then immediately return OK.
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Redirect the current request to some other uri
Packit 90a5c9
 * @param new_uri The URI to replace the current request with
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_internal_redirect(const char *new_uri, request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This function is designed for things like actions or CGI scripts, when
Packit 90a5c9
 * using AddHandler, and you want to preserve the content type across
Packit 90a5c9
 * an internal redirect.
Packit 90a5c9
 * @param new_uri The URI to replace the current request with.
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_internal_redirect_handler(const char *new_uri, request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Redirect the current request to a sub_req, merging the pools
Packit 90a5c9
 * @param sub_req A subrequest created from this request
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @note the sub_req's pool will be merged into r's pool, be very careful
Packit 90a5c9
 * not to destroy this subrequest, it will be destroyed with the main request!
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_internal_fast_redirect(request_rec *sub_req, request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Can be used within any handler to determine if any authentication
Packit 90a5c9
 * is required for the current request
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return 1 if authentication is required, 0 otherwise
Packit 90a5c9
 * @bug Behavior changed in 2.4.x refactoring, API no longer usable
Packit 90a5c9
 * @deprecated @see ap_some_authn_required()
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_some_auth_required(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @defgroup APACHE_CORE_REQ_AUTH Access Control for Sub-Requests and
Packit 90a5c9
 *                                Internal Redirects
Packit 90a5c9
 * @ingroup  APACHE_CORE_REQ
Packit 90a5c9
 * @{
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
#define AP_AUTH_INTERNAL_PER_URI  0  /**< Run access control hooks on all
Packit 90a5c9
                                          internal requests with URIs
Packit 90a5c9
                                          distinct from that of initial
Packit 90a5c9
                                          request */
Packit 90a5c9
#define AP_AUTH_INTERNAL_PER_CONF 1  /**< Run access control hooks only on
Packit 90a5c9
                                          internal requests with
Packit 90a5c9
                                          configurations distinct from
Packit 90a5c9
                                          that of initial request */
Packit 90a5c9
#define AP_AUTH_INTERNAL_MASK     0x000F  /**< mask to extract internal request
Packit 90a5c9
                                               processing mode */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Clear flag which determines when access control hooks will be run for
Packit 90a5c9
 * internal requests.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_clear_auth_internal(void);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Determine whether access control hooks will be run for all internal
Packit 90a5c9
 * requests with URIs distinct from that of the initial request, or only
Packit 90a5c9
 * those for which different configurations apply than those which applied
Packit 90a5c9
 * to the initial request.  To accommodate legacy external modules which
Packit 90a5c9
 * may expect access control hooks to be run for all internal requests
Packit 90a5c9
 * with distinct URIs, this is the default behaviour unless all access
Packit 90a5c9
 * control hooks and authentication and authorization providers are
Packit 90a5c9
 * registered with AP_AUTH_INTERNAL_PER_CONF.
Packit 90a5c9
 * @param ptemp Pool used for temporary allocations
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_setup_auth_internal(apr_pool_t *ptemp);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Register an authentication or authorization provider with the global
Packit 90a5c9
 * provider pool.
Packit 90a5c9
 * @param pool The pool to create any storage from
Packit 90a5c9
 * @param provider_group The group to store the provider in
Packit 90a5c9
 * @param provider_name The name for this provider
Packit 90a5c9
 * @param provider_version The version for this provider
Packit 90a5c9
 * @param provider Opaque structure for this provider
Packit 90a5c9
 * @param type Internal request processing mode, either
Packit 90a5c9
 *             AP_AUTH_INTERNAL_PER_URI or AP_AUTH_INTERNAL_PER_CONF
Packit 90a5c9
 * @return APR_SUCCESS if all went well
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(apr_status_t) ap_register_auth_provider(apr_pool_t *pool,
Packit 90a5c9
                                                   const char *provider_group,
Packit 90a5c9
                                                   const char *provider_name,
Packit 90a5c9
                                                   const char *provider_version,
Packit 90a5c9
                                                   const void *provider,
Packit 90a5c9
                                                   int type);
Packit 90a5c9
Packit 90a5c9
/** @} */
Packit 90a5c9
Packit 90a5c9
/* Optional functions coming from mod_authn_core and mod_authz_core
Packit 90a5c9
 * that list all registered authn/z providers.
Packit 90a5c9
 */
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(apr_array_header_t *, authn_ap_list_provider_names,
Packit 90a5c9
                        (apr_pool_t *ptemp));
Packit 90a5c9
APR_DECLARE_OPTIONAL_FN(apr_array_header_t *, authz_ap_list_provider_names,
Packit 90a5c9
                        (apr_pool_t *ptemp));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Determine if the current request is the main request or a subrequest
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return 1 if this is the main request, 0 otherwise
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_is_initial_req(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Function to set the r->mtime field to the specified value if it's later
Packit 90a5c9
 * than what's already there.
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @param dependency_mtime Time to set the mtime to
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_update_mtime(request_rec *r, apr_time_t dependency_mtime);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Add one or more methods to the list permitted to access the resource.
Packit 90a5c9
 * Usually executed by the content handler before the response header is
Packit 90a5c9
 * sent, but sometimes invoked at an earlier phase if a module knows it
Packit 90a5c9
 * can set the list authoritatively.  Note that the methods are ADDED
Packit 90a5c9
 * to any already permitted unless the reset flag is non-zero.  The
Packit 90a5c9
 * list is used to generate the Allow response header field when it
Packit 90a5c9
 * is needed.
Packit 90a5c9
 * @param   r     The pointer to the request identifying the resource.
Packit 90a5c9
 * @param   reset Boolean flag indicating whether this list should
Packit 90a5c9
 *                completely replace any current settings.
Packit 90a5c9
 * @param   ...   A NULL-terminated list of strings, each identifying a
Packit 90a5c9
 *                method name to add.
Packit 90a5c9
 * @return  None.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_allow_methods(request_rec *r, int reset, ...)
Packit 90a5c9
                 AP_FN_ATTR_SENTINEL;
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Add one or more methods to the list permitted to access the resource.
Packit 90a5c9
 * Usually executed by the content handler before the response header is
Packit 90a5c9
 * sent, but sometimes invoked at an earlier phase if a module knows it
Packit 90a5c9
 * can set the list authoritatively.  Note that the methods are ADDED
Packit 90a5c9
 * to any already permitted unless the reset flag is non-zero.  The
Packit 90a5c9
 * list is used to generate the Allow response header field when it
Packit 90a5c9
 * is needed.
Packit 90a5c9
 * @param   r     The pointer to the request identifying the resource.
Packit 90a5c9
 * @param   reset Boolean flag indicating whether this list should
Packit 90a5c9
 *                completely replace any current settings.
Packit 90a5c9
 * @param   ...   A list of method identifiers, from the "M_" series
Packit 90a5c9
 *                defined in httpd.h, terminated with a value of -1
Packit 90a5c9
 *                (e.g., "M_GET, M_POST, M_OPTIONS, -1")
Packit 90a5c9
 * @return  None.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_allow_standard_methods(request_rec *r, int reset, ...);
Packit 90a5c9
Packit 90a5c9
#define MERGE_ALLOW 0
Packit 90a5c9
#define REPLACE_ALLOW 1
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Process a top-level request from a client, and synchronously write
Packit 90a5c9
 * the response to the client
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_process_request(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/* For post-processing after a handler has finished with a request.
Packit 90a5c9
 * (Commonly used after it was suspended)
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_process_request_after_handler(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Process a top-level request from a client, allowing some or all of
Packit 90a5c9
 * the response to remain buffered in the core output filter for later,
Packit 90a5c9
 * asynchronous write completion
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 */
Packit 90a5c9
void ap_process_async_request(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Kill the current request
Packit 90a5c9
 * @param type Why the request is dieing
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_die(int type, request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Check whether a connection is still established and has data available,
Packit 90a5c9
 * optionnaly consuming blank lines ([CR]LF).
Packit 90a5c9
 * @param c The current connection
Packit 90a5c9
 * @param bb The brigade to filter
Packit 90a5c9
 * @param max_blank_lines Max number of blank lines to consume, or zero
Packit 90a5c9
 *                        to consider them as data (single read).
Packit 90a5c9
 * @return APR_SUCCESS: connection established with data available,
Packit 90a5c9
 *         APR_EAGAIN: connection established and empty,
Packit 90a5c9
 *         APR_NOTFOUND: too much blank lines,
Packit 90a5c9
 *         APR_E*: connection/general error.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(apr_status_t) ap_check_pipeline(conn_rec *c, apr_bucket_brigade *bb,
Packit 90a5c9
                                           unsigned int max_blank_lines);
Packit 90a5c9
Packit 90a5c9
/* Hooks */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Gives modules a chance to create their request_config entry when the
Packit 90a5c9
 * request is created.
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,create_request,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook allow modules an opportunity to translate the URI into an
Packit 90a5c9
 * actual filename.  If no modules do anything special, the server's default
Packit 90a5c9
 * rules will be followed.
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return OK, DECLINED, or HTTP_...
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,translate_name,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook allow modules to set the per_dir_config based on their own
Packit 90a5c9
 * context (such as "<Proxy>" sections) and responds to contextless requests
Packit 90a5c9
 * such as TRACE that need no security or filesystem mapping.
Packit 90a5c9
 * based on the filesystem.
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return DONE (or HTTP_) if this contextless request was just fulfilled
Packit 90a5c9
 * (such as TRACE), OK if this is not a file, and DECLINED if this is a file.
Packit 90a5c9
 * The core map_to_storage (HOOK_RUN_REALLY_LAST) will directory_walk
Packit 90a5c9
 * and file_walk the r->filename.
Packit 90a5c9
 *
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,map_to_storage,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook is used to analyze the request headers, authenticate the user,
Packit 90a5c9
 * and set the user information in the request record (r->user and
Packit 90a5c9
 * r->ap_auth_type). This hook is only run when Apache determines that
Packit 90a5c9
 * authentication/authorization is required for this resource (as determined
Packit 90a5c9
 * by the 'Require' directive). It runs after the access_checker hook, and
Packit 90a5c9
 * before the auth_checker hook. This hook should be registered with
Packit 90a5c9
 * ap_hook_check_authn().
Packit 90a5c9
 *
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return OK, DECLINED, or HTTP_...
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 * @see ap_hook_check_authn
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,check_user_id,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Allows modules to perform module-specific fixing of header fields.  This
Packit 90a5c9
 * is invoked just before any content-handler
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return OK, DECLINED, or HTTP_...
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,fixups,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This routine is called to determine and/or set the various document type
Packit 90a5c9
 * information bits, like Content-type (via r->content_type), language, et
Packit 90a5c9
 * cetera.
Packit 90a5c9
 * @param r the current request
Packit 90a5c9
 * @return OK, DECLINED, or HTTP_...
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,type_checker,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook is used to apply additional access control to this resource.
Packit 90a5c9
 * It runs *before* a user is authenticated, so this hook is really to
Packit 90a5c9
 * apply additional restrictions independent of a user. It also runs
Packit 90a5c9
 * independent of 'Require' directive usage. This hook should be registered
Packit 90a5c9
 * with ap_hook_check_access().
Packit 90a5c9
 *
Packit 90a5c9
 * @param r the current request
Packit 90a5c9
 * @return OK, DECLINED, or HTTP_...
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 * @see ap_hook_check_access
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,access_checker,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook is used to apply additional access control and/or bypass
Packit 90a5c9
 * authentication for this resource. It runs *before* a user is authenticated,
Packit 90a5c9
 * but after the auth_checker hook.
Packit 90a5c9
 * This hook should be registered with ap_hook_check_access_ex().
Packit 90a5c9
 *
Packit 90a5c9
 * @param r the current request
Packit 90a5c9
 * @return OK (allow acces), DECLINED (let later modules decide),
Packit 90a5c9
 *         or HTTP_... (deny access)
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 * @see ap_hook_check_access_ex
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,access_checker_ex,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook is used to check to see if the resource being requested
Packit 90a5c9
 * is available for the authenticated user (r->user and r->ap_auth_type).
Packit 90a5c9
 * It runs after the access_checker and check_user_id hooks. Note that
Packit 90a5c9
 * it will *only* be called if Apache determines that access control has
Packit 90a5c9
 * been applied to this resource (through a 'Require' directive). This
Packit 90a5c9
 * hook should be registered with ap_hook_check_authz().
Packit 90a5c9
 *
Packit 90a5c9
 * @param r the current request
Packit 90a5c9
 * @return OK, DECLINED, or HTTP_...
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 * @see ap_hook_check_authz
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,auth_checker,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Register a hook function that will apply additional access control to
Packit 90a5c9
 * the current request.
Packit 90a5c9
 * @param pf An access_checker hook function
Packit 90a5c9
 * @param aszPre A NULL-terminated array of strings that name modules whose
Packit 90a5c9
 *               hooks should precede this one
Packit 90a5c9
 * @param aszSucc A NULL-terminated array of strings that name modules whose
Packit 90a5c9
 *                hooks should succeed this one
Packit 90a5c9
 * @param nOrder An integer determining order before honouring aszPre and
Packit 90a5c9
 *               aszSucc (for example, HOOK_MIDDLE)
Packit 90a5c9
 * @param type Internal request processing mode, either
Packit 90a5c9
 *             AP_AUTH_INTERNAL_PER_URI or AP_AUTH_INTERNAL_PER_CONF
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_hook_check_access(ap_HOOK_access_checker_t *pf,
Packit 90a5c9
                                      const char * const *aszPre,
Packit 90a5c9
                                      const char * const *aszSucc,
Packit 90a5c9
                                      int nOrder, int type);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Register a hook function that will apply additional access control
Packit 90a5c9
 * and/or bypass authentication for the current request.
Packit 90a5c9
 * @param pf An access_checker_ex hook function
Packit 90a5c9
 * @param aszPre A NULL-terminated array of strings that name modules whose
Packit 90a5c9
 *               hooks should precede this one
Packit 90a5c9
 * @param aszSucc A NULL-terminated array of strings that name modules whose
Packit 90a5c9
 *                hooks should succeed this one
Packit 90a5c9
 * @param nOrder An integer determining order before honouring aszPre and
Packit 90a5c9
 *               aszSucc (for example, HOOK_MIDDLE)
Packit 90a5c9
 * @param type Internal request processing mode, either
Packit 90a5c9
 *             AP_AUTH_INTERNAL_PER_URI or AP_AUTH_INTERNAL_PER_CONF
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_hook_check_access_ex(ap_HOOK_access_checker_ex_t *pf,
Packit 90a5c9
                                         const char * const *aszPre,
Packit 90a5c9
                                         const char * const *aszSucc,
Packit 90a5c9
                                         int nOrder, int type);
Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Register a hook function that will analyze the request headers,
Packit 90a5c9
 * authenticate the user, and set the user information in the request record.
Packit 90a5c9
 * @param pf A check_user_id hook function
Packit 90a5c9
 * @param aszPre A NULL-terminated array of strings that name modules whose
Packit 90a5c9
 *               hooks should precede this one
Packit 90a5c9
 * @param aszSucc A NULL-terminated array of strings that name modules whose
Packit 90a5c9
 *                hooks should succeed this one
Packit 90a5c9
 * @param nOrder An integer determining order before honouring aszPre and
Packit 90a5c9
 *               aszSucc (for example, HOOK_MIDDLE)
Packit 90a5c9
 * @param type Internal request processing mode, either
Packit 90a5c9
 *             AP_AUTH_INTERNAL_PER_URI or AP_AUTH_INTERNAL_PER_CONF
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_hook_check_authn(ap_HOOK_check_user_id_t *pf,
Packit 90a5c9
                                     const char * const *aszPre,
Packit 90a5c9
                                     const char * const *aszSucc,
Packit 90a5c9
                                     int nOrder, int type);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Register a hook function that determine if the resource being requested
Packit 90a5c9
 * is available for the currently authenticated user.
Packit 90a5c9
 * @param pf An auth_checker hook function
Packit 90a5c9
 * @param aszPre A NULL-terminated array of strings that name modules whose
Packit 90a5c9
 *               hooks should precede this one
Packit 90a5c9
 * @param aszSucc A NULL-terminated array of strings that name modules whose
Packit 90a5c9
 *                hooks should succeed this one
Packit 90a5c9
 * @param nOrder An integer determining order before honouring aszPre and
Packit 90a5c9
 *               aszSucc (for example, HOOK_MIDDLE)
Packit 90a5c9
 * @param type Internal request processing mode, either
Packit 90a5c9
 *             AP_AUTH_INTERNAL_PER_URI or AP_AUTH_INTERNAL_PER_CONF
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_hook_check_authz(ap_HOOK_auth_checker_t *pf,
Packit 90a5c9
                                     const char * const *aszPre,
Packit 90a5c9
                                     const char * const *aszSucc,
Packit 90a5c9
                                     int nOrder, int type);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook allows modules to insert filters for the current request
Packit 90a5c9
 * @param r the current request
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(void,insert_filter,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook allows modules to affect the request immediately after the
Packit 90a5c9
 * per-directory configuration for the request has been generated.
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return OK (allow acces), DECLINED (let later modules decide),
Packit 90a5c9
 *         or HTTP_... (deny access)
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,post_perdir_config,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook allows a module to force authn to be required when
Packit 90a5c9
 * processing a request.
Packit 90a5c9
 * This hook should be registered with ap_hook_force_authn().
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return OK (force authn), DECLINED (let later modules decide)
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,force_authn,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This hook allows modules to handle/emulate the apr_stat() calls
Packit 90a5c9
 * needed for directory walk.
Packit 90a5c9
 * @param finfo where to put the stat data
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @param wanted APR_FINFO_* flags to pass to apr_stat()
Packit 90a5c9
 * @return apr_status_t or AP_DECLINED (let later modules decide)
Packit 90a5c9
 * @ingroup hooks
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(apr_status_t,dirwalk_stat,(apr_finfo_t *finfo, request_rec *r, apr_int32_t wanted))
Packit 90a5c9
Packit 90a5c9
AP_DECLARE(int) ap_location_walk(request_rec *r);
Packit 90a5c9
AP_DECLARE(int) ap_directory_walk(request_rec *r);
Packit 90a5c9
AP_DECLARE(int) ap_file_walk(request_rec *r);
Packit 90a5c9
AP_DECLARE(int) ap_if_walk(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/** End Of REQUEST (EOR) bucket */
Packit 90a5c9
AP_DECLARE_DATA extern const apr_bucket_type_t ap_bucket_type_eor;
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Determine if a bucket is an End Of REQUEST (EOR) bucket
Packit 90a5c9
 * @param e The bucket to inspect
Packit 90a5c9
 * @return true or false
Packit 90a5c9
 */
Packit 90a5c9
#define AP_BUCKET_IS_EOR(e)         (e->type == &ap_bucket_type_eor)
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Make the bucket passed in an End Of REQUEST (EOR) bucket
Packit 90a5c9
 * @param b The bucket to make into an EOR bucket
Packit 90a5c9
 * @param r The request to destroy when this bucket is destroyed
Packit 90a5c9
 * @return The new bucket, or NULL if allocation failed
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(apr_bucket *) ap_bucket_eor_make(apr_bucket *b, request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Create a bucket referring to an End Of REQUEST (EOR). This bucket
Packit 90a5c9
 * holds a pointer to the request_rec, so that the request can be
Packit 90a5c9
 * destroyed right after all of the output has been sent to the client.
Packit 90a5c9
 *
Packit 90a5c9
 * @param list The freelist from which this bucket should be allocated
Packit 90a5c9
 * @param r The request to destroy when this bucket is destroyed
Packit 90a5c9
 * @return The new bucket, or NULL if allocation failed
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(apr_bucket *) ap_bucket_eor_create(apr_bucket_alloc_t *list,
Packit 90a5c9
                                              request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Can be used within any handler to determine if any authentication
Packit 90a5c9
 * is required for the current request.  Note that if used with an
Packit 90a5c9
 * access_checker hook, an access_checker_ex hook or an authz provider; the
Packit 90a5c9
 * caller should take steps to avoid a loop since this function is
Packit 90a5c9
 * implemented by calling these hooks.
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return TRUE if authentication is required, FALSE otherwise
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_some_authn_required(request_rec *r);
Packit 90a5c9
Packit 90a5c9
#ifdef __cplusplus
Packit 90a5c9
}
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
#endif  /* !APACHE_HTTP_REQUEST_H */
Packit 90a5c9
/** @} */