http_config.h revision a253b0b3e7a5a72e32c0571a2faf336a5f5f54ba
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* ====================================================================
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The Apache Software License, Version 1.1
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Copyright (c) 2000 The Apache Software Foundation. All rights
fe9cf88cfb7f7c907afaf3ce896eda314b1cc074perrin * reserved.
fe9cf88cfb7f7c907afaf3ce896eda314b1cc074perrin *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Redistribution and use in source and binary forms, with or without
fa9e4066f08beec538e775443c5be79dd423fcabahrens * modification, are permitted provided that the following conditions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * are met:
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 1. Redistributions of source code must retain the above copyright
fa9e4066f08beec538e775443c5be79dd423fcabahrens * notice, this list of conditions and the following disclaimer.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 2. Redistributions in binary form must reproduce the above copyright
fa9e4066f08beec538e775443c5be79dd423fcabahrens * notice, this list of conditions and the following disclaimer in
fa9e4066f08beec538e775443c5be79dd423fcabahrens * the documentation and/or other materials provided with the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * distribution.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 3. The end-user documentation included with the redistribution,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * if any, must include the following acknowledgment:
fa9e4066f08beec538e775443c5be79dd423fcabahrens * "This product includes software developed by the
ab69d62f363ee70f4e4cded1092a68cc0c63136fMatthew Ahrens * Apache Software Foundation (http://www.apache.org/)."
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Alternately, this acknowledgment may appear in the software itself,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * if and wherever such third-party acknowledgments normally appear.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 4. The names "Apache" and "Apache Software Foundation" must
fa9e4066f08beec538e775443c5be79dd423fcabahrens * not be used to endorse or promote products derived from this
e6ca193ded880d478cc39e34ef82d4be36e4445dGeorge Wilson * software without prior written permission. For written
fa9e4066f08beec538e775443c5be79dd423fcabahrens * permission, please contact apache@apache.org.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 5. Products derived from this software may not be called "Apache",
fa9e4066f08beec538e775443c5be79dd423fcabahrens * nor may "Apache" appear in their name, without prior written
fa9e4066f08beec538e775443c5be79dd423fcabahrens * permission of the Apache Software Foundation.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
fa9e4066f08beec538e775443c5be79dd423fcabahrens * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
fa9e4066f08beec538e775443c5be79dd423fcabahrens * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
d63d470b66194d40e74d5a669bd21e215bd63fc2gw * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
fa9e4066f08beec538e775443c5be79dd423fcabahrens * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
fa9e4066f08beec538e775443c5be79dd423fcabahrens * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
fa9e4066f08beec538e775443c5be79dd423fcabahrens * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
fa9e4066f08beec538e775443c5be79dd423fcabahrens * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
fa9e4066f08beec538e775443c5be79dd423fcabahrens * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
fa9e4066f08beec538e775443c5be79dd423fcabahrens * SUCH DAMAGE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * ====================================================================
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * This software consists of voluntary contributions made by many
fa9e4066f08beec538e775443c5be79dd423fcabahrens * individuals on behalf of the Apache Software Foundation. For more
fa9e4066f08beec538e775443c5be79dd423fcabahrens * information on the Apache Software Foundation, please see
fa9e4066f08beec538e775443c5be79dd423fcabahrens * <http://www.apache.org/>.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Portions of this software are based upon public domain software
fa9e4066f08beec538e775443c5be79dd423fcabahrens * originally written at the National Center for Supercomputing Applications,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * University of Illinois, Urbana-Champaign.
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifndef APACHE_HTTP_CONFIG_H
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define APACHE_HTTP_CONFIG_H
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#include "ap_hooks.h"
fa9e4066f08beec538e775443c5be79dd423fcabahrens#include "util_cfgtree.h"
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifdef __cplusplus
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
416e0cd82df71e380f21199abde8c5f7a18bac51ek#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
416e0cd82df71e380f21199abde8c5f7a18bac51ek * The central data structures around here...
416e0cd82df71e380f21199abde8c5f7a18bac51ek */
416e0cd82df71e380f21199abde8c5f7a18bac51ek
416e0cd82df71e380f21199abde8c5f7a18bac51ek/* Command dispatch structures... */
416e0cd82df71e380f21199abde8c5f7a18bac51ek
416e0cd82df71e380f21199abde8c5f7a18bac51ek/* Note that for all of these except RAW_ARGS, the config routine is
416e0cd82df71e380f21199abde8c5f7a18bac51ek * passed a freshly allocated string which can be modified or stored
fa9e4066f08beec538e775443c5be79dd423fcabahrens * or whatever... it's only necessary to do pstrdup() stuff with
fa9e4066f08beec538e775443c5be79dd423fcabahrens * RAW_ARGS.
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
8f18d1fadf6a0c20fac9ff7259a5368faa3c3bfbGeorge Wilsonenum cmd_how {
8f18d1fadf6a0c20fac9ff7259a5368faa3c3bfbGeorge Wilson RAW_ARGS, /* cmd_func parses command line itself */
fa9e4066f08beec538e775443c5be79dd423fcabahrens TAKE1, /* one argument only */
fa9e4066f08beec538e775443c5be79dd423fcabahrens TAKE2, /* two arguments only */
fa9e4066f08beec538e775443c5be79dd423fcabahrens ITERATE, /* one argument, occuring multiple times
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (e.g., IndexIgnore)
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens ITERATE2, /* two arguments, 2nd occurs multiple times
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (e.g., AddIcon)
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens FLAG, /* One of 'On' or 'Off' */
fa9e4066f08beec538e775443c5be79dd423fcabahrens NO_ARGS, /* No args at all, e.g. </Directory> */
fa9e4066f08beec538e775443c5be79dd423fcabahrens TAKE12, /* one or two arguments */
fa9e4066f08beec538e775443c5be79dd423fcabahrens TAKE3, /* three arguments only */
fa9e4066f08beec538e775443c5be79dd423fcabahrens TAKE23, /* two or three arguments */
fa9e4066f08beec538e775443c5be79dd423fcabahrens TAKE123, /* one, two or three arguments */
fa9e4066f08beec538e775443c5be79dd423fcabahrens TAKE13 /* one or three arguments */
fa9e4066f08beec538e775443c5be79dd423fcabahrens};
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrenstypedef struct command_struct {
fa9e4066f08beec538e775443c5be79dd423fcabahrens const char *name; /* Name of this command */
fa9e4066f08beec538e775443c5be79dd423fcabahrens const char *(*func) (); /* Function invoked */
fa9e4066f08beec538e775443c5be79dd423fcabahrens void *cmd_data; /* Extra data, for functions which
fa9e4066f08beec538e775443c5be79dd423fcabahrens * implement multiple commands...
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens int req_override; /* What overrides need to be allowed to
fa9e4066f08beec538e775443c5be79dd423fcabahrens * enable this command.
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens enum cmd_how args_how; /* What the command expects as arguments */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens const char *errmsg; /* 'usage' message, in case of syntax errors */
fa9e4066f08beec538e775443c5be79dd423fcabahrens} command_rec;
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* The allowed locations for a configuration directive are the union of
fa9e4066f08beec538e775443c5be79dd423fcabahrens * those indicated by each set bit in the req_override mask.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (req_override & RSRC_CONF) => *.conf outside <Directory> or <Location>
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (req_override & ACCESS_CONF) => *.conf inside <Directory> or <Location>
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (req_override & OR_AUTHCFG) => *.conf inside <Directory> or <Location>
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and .htaccess when AllowOverride AuthConfig
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (req_override & OR_LIMIT) => *.conf inside <Directory> or <Location>
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and .htaccess when AllowOverride Limit
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (req_override & OR_OPTIONS) => *.conf anywhere
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and .htaccess when AllowOverride Options
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (req_override & OR_FILEINFO) => *.conf anywhere
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and .htaccess when AllowOverride FileInfo
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (req_override & OR_INDEXES) => *.conf anywhere
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and .htaccess when AllowOverride Indexes
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define OR_NONE 0
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define OR_LIMIT 1
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define OR_OPTIONS 2
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define OR_FILEINFO 4
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define OR_AUTHCFG 8
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define OR_INDEXES 16
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define OR_UNSET 32
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick#define ACCESS_CONF 64
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick#define RSRC_CONF 128
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick#define OR_ALL (OR_LIMIT|OR_OPTIONS|OR_FILEINFO|OR_AUTHCFG|OR_INDEXES)
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick/* This can be returned by a function if they don't wish to handle
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * a command. Make it something not likely someone will actually use
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * as an error code.
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick#define DECLINE_CMD "\a\b"
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick/*
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * This structure is passed to a command which is being invoked,
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * to carry a large variety of miscellaneous data which is all of
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * use to *somebody*...
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrenstypedef struct {
fa9e4066f08beec538e775443c5be79dd423fcabahrens void *info; /* Argument to command from cmd_table */
fa9e4066f08beec538e775443c5be79dd423fcabahrens int override; /* Which allow-override bits are set */
fa9e4066f08beec538e775443c5be79dd423fcabahrens int limited; /* Which methods are <Limit>ed */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrens configfile_t *config_file; /* Config file structure from pcfg_openfile() */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock ap_pool_t *pool; /* Pool to allocate new storage in */
13506d1eefbbc37e2f12a0528831d9f6d4c361d7maybee ap_pool_t *temp_pool; /* Pool for scratch memory; persists during
fa9e4066f08beec538e775443c5be79dd423fcabahrens * configuration, but wiped before the first
fa9e4066f08beec538e775443c5be79dd423fcabahrens * request is served...
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick */
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock server_rec *server; /* Server_rec being configured for */
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock char *path; /* If configuring for a directory,
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * pathname of that directory.
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * NOPE! That's what it meant previous to the
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * existance of <Files>, <Location> and regex
fa9e4066f08beec538e775443c5be79dd423fcabahrens * matching. Now the only usefulness that can
088f389458728c464569a5506b58070254fa4f7dahrens * be derived from this field is whether a command
088f389458728c464569a5506b58070254fa4f7dahrens * is being called in a server context (path == NULL)
088f389458728c464569a5506b58070254fa4f7dahrens * or being called in a dir context (path != NULL).
088f389458728c464569a5506b58070254fa4f7dahrens */
088f389458728c464569a5506b58070254fa4f7dahrens const command_rec *cmd; /* configuration command */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick const char *end_token; /* end token required to end a nested section */
13506d1eefbbc37e2f12a0528831d9f6d4c361d7maybee void *context; /* per_dir_config vector passed
fa9e4066f08beec538e775443c5be79dd423fcabahrens * to handle_command */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick} cmd_parms;
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick/* This structure records the existence of handlers in a module... */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwicktypedef struct {
fa9e4066f08beec538e775443c5be79dd423fcabahrens const char *content_type; /* MUST be all lower case */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick int (*handler) (request_rec *);
f5e6e7228435b0d75acff659a4ec6399d46ded6cNeil Perrin} handler_rec;
f5e6e7228435b0d75acff659a4ec6399d46ded6cNeil Perrin
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick/*
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * Module structures. Just about everything is dispatched through
f5e6e7228435b0d75acff659a4ec6399d46ded6cNeil Perrin * these, directly or indirectly (through the command and handler
f5e6e7228435b0d75acff659a4ec6399d46ded6cNeil Perrin * tables).
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwicktypedef struct module_struct {
f5e6e7228435b0d75acff659a4ec6399d46ded6cNeil Perrin int version; /* API version, *not* module version;
f5e6e7228435b0d75acff659a4ec6399d46ded6cNeil Perrin * check that module is compatible with this
f5e6e7228435b0d75acff659a4ec6399d46ded6cNeil Perrin * version of the server.
f5e6e7228435b0d75acff659a4ec6399d46ded6cNeil Perrin */
f5e6e7228435b0d75acff659a4ec6399d46ded6cNeil Perrin int minor_version; /* API minor version. Provides API feature
fa9e4066f08beec538e775443c5be79dd423fcabahrens * milestones. Not checked during module init
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick int module_index; /* Index to this modules structures in
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * config vectors.
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens const char *name;
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick void *dynamic_load_handle;
fa9e4066f08beec538e775443c5be79dd423fcabahrens
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick struct module_struct *next;
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens unsigned long magic; /* Magic Cookie to identify a module structure;
fa9e4066f08beec538e775443c5be79dd423fcabahrens * It's mainly important for the DSO facility
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (see also mod_so).
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick */
fa9e4066f08beec538e775443c5be79dd423fcabahrens void (*pre_config) (ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick void *(*create_dir_config) (ap_pool_t *p, char *dir);
fa9e4066f08beec538e775443c5be79dd423fcabahrens void *(*merge_dir_config) (ap_pool_t *p, void *base_conf, void *new_conf);
fa9e4066f08beec538e775443c5be79dd423fcabahrens void *(*create_server_config) (ap_pool_t *p, server_rec *s);
fa9e4066f08beec538e775443c5be79dd423fcabahrens void *(*merge_server_config) (ap_pool_t *p, void *base_conf, void *new_conf);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick const command_rec *cmds;
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick const handler_rec *handlers;
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick /* Hooks for getting into the middle of server ops...
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrens * translate_handler --- translate URI to filename
fa9e4066f08beec538e775443c5be79dd423fcabahrens * access_checker --- check access by host address, etc. All of these
fa9e4066f08beec538e775443c5be79dd423fcabahrens * run; if all decline, that's still OK.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * check_user_id --- get and validate user id from the HTTP request
fa9e4066f08beec538e775443c5be79dd423fcabahrens * auth_checker --- see if the user (from check_user_id) is OK *here*.
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * If all of *these* decline, the request is rejected
fa9e4066f08beec538e775443c5be79dd423fcabahrens * (as a SERVER_ERROR, since the module which was
fa9e4066f08beec538e775443c5be79dd423fcabahrens * supposed to handle this was configured wrong).
fa9e4066f08beec538e775443c5be79dd423fcabahrens * type_checker --- Determine MIME type of the requested entity;
fa9e4066f08beec538e775443c5be79dd423fcabahrens * sets content_type, _encoding and _language fields.
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens void (*register_hooks) (void);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick} module;
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* Initializer for the first few module slots, which are only
fa9e4066f08beec538e775443c5be79dd423fcabahrens * really set up once we start running. Note that the first two slots
fa9e4066f08beec538e775443c5be79dd423fcabahrens * provide a version check; this should allow us to deal with changes to
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * the API. The major number should reflect changes to the API handler table
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * itself or removal of functionality. The minor number should reflect
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * additions of functionality to the existing API. (the server can detect
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * an old-format module, and either handle it back-compatibly, or at least
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * signal an error). See src/include/ap_mmn.h for MMN version history.
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick#define STANDARD_MODULE_STUFF this_module_needs_to_be_ported_to_apache_2_0
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define STANDARD20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
fa9e4066f08beec538e775443c5be79dd423fcabahrens MODULE_MAGIC_NUMBER_MINOR, \
fa9e4066f08beec538e775443c5be79dd423fcabahrens -1, \
fa9e4066f08beec538e775443c5be79dd423fcabahrens __FILE__, \
fa9e4066f08beec538e775443c5be79dd423fcabahrens NULL, \
fa9e4066f08beec538e775443c5be79dd423fcabahrens NULL, \
fa9e4066f08beec538e775443c5be79dd423fcabahrens MODULE_MAGIC_COOKIE, \
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick NULL
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define MPM20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
fa9e4066f08beec538e775443c5be79dd423fcabahrens MODULE_MAGIC_NUMBER_MINOR, \
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick -1, \
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick __FILE__, \
fa9e4066f08beec538e775443c5be79dd423fcabahrens NULL, \
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick NULL, \
fa9e4066f08beec538e775443c5be79dd423fcabahrens MODULE_MAGIC_COOKIE
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* Generic accessors for other modules to get at their own module-specific
fa9e4066f08beec538e775443c5be79dd423fcabahrens * data
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(void *) ap_get_module_config(void *conf_vector, module *m);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickAPI_EXPORT(void) ap_set_module_config(void *conf_vector, module *m, void *val);
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define ap_get_module_config(v,m) \
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick (((void **)(v))[(m)->module_index])
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick#define ap_set_module_config(v,m,val) \
fa9e4066f08beec538e775443c5be79dd423fcabahrens ((((void **)(v))[(m)->module_index]) = (val))
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* Generic command handling function... */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT_NONSTD(const char *) ap_set_string_slot(cmd_parms *, char *, char *);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *, char *, char *);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT_NONSTD(const char *) ap_set_flag_slot(cmd_parms *, char *, int);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *, char *, char *);
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* For modules which need to read config files, open logs, etc. ...
fa9e4066f08beec538e775443c5be79dd423fcabahrens * this returns the fname argument if it begins with '/'; otherwise
fa9e4066f08beec538e775443c5be79dd423fcabahrens * it relativizes it wrt server_root.
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff BonwickAPI_EXPORT(const char *) ap_server_root_relative(ap_pool_t *p, const char *fname);
e14bb3258d05c1b1077e2db7cf77088924e56919Jeff Bonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* Finally, the hook for dynamically loading modules in... */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(void) ap_add_module(module *m);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(void) ap_remove_module(module *m);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(void) ap_add_loaded_module(module *mod);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(void) ap_remove_loaded_module(module *mod);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(int) ap_add_named_module(const char *name);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(void) ap_clear_module_list(void);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(const char *) ap_find_module_name(module *m);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(module *) ap_find_linked_module(const char *name);
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* for implementing subconfigs and customized config files */
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(ap_directive_t *) ap_build_config(cmd_parms *parms, ap_directive_t *current);
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(const char *)ap_walk_config(ap_directive_t *conftree, cmd_parms *parms, void *config, int container);
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* ap_check_cmd_context() definitions: */
fa9e4066f08beec538e775443c5be79dd423fcabahrensAPI_EXPORT(const char *) ap_check_cmd_context(cmd_parms *cmd, unsigned forbidden);
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* ap_check_cmd_context(): Forbidden in: */
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define NOT_IN_VIRTUALHOST 0x01 /* <Virtualhost> */
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define NOT_IN_LIMIT 0x02 /* <Limit> */
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define NOT_IN_DIRECTORY 0x04 /* <Directory> */
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define NOT_IN_LOCATION 0x08 /* <Location> */
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define NOT_IN_FILES 0x10 /* <Files> */
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define NOT_IN_DIR_LOC_FILE (NOT_IN_DIRECTORY|NOT_IN_LOCATION|NOT_IN_FILES) /* <Directory>/<Location>/<Files>*/
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define GLOBAL_ONLY (NOT_IN_VIRTUALHOST|NOT_IN_LIMIT|NOT_IN_DIR_LOC_FILE)
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifdef CORE_PRIVATE
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern API_VAR_EXPORT module *top_module;
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern module *ap_prelinked_modules[];
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern module *ap_preloaded_modules[];
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern API_VAR_EXPORT module **ap_loaded_modules;
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* For mod_so.c... */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensvoid ap_single_module_configure(ap_pool_t *p, server_rec *s, module *m);
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* For http_main.c... */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensvoid ap_setup_prelinked_modules(process_rec *process);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickvoid ap_show_directives(void);
fa9e4066f08beec538e775443c5be79dd423fcabahrensvoid ap_show_modules(void);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickserver_rec *ap_read_config(process_rec *process, ap_pool_t *temp_pool, const char *config_name);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickvoid ap_post_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s);
fa9e4066f08beec538e775443c5be79dd423fcabahrensvoid ap_child_init_hook(ap_pool_t *pchild, server_rec *s);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrensvoid ap_register_hooks(module *m);
fa9e4066f08beec538e775443c5be79dd423fcabahrensvoid ap_hook_deregister_all(void);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* For http_request.c... */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickvoid *ap_create_request_config(ap_pool_t *p);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickCORE_EXPORT(void *) ap_create_per_dir_config(ap_pool_t *p);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickvoid *ap_merge_per_dir_configs(ap_pool_t *p, void *base, void *new);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick/* For http_connection.c... */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrensvoid *ap_create_conn_config(ap_pool_t *p);
899217dd4c82fc8ec67006fe51e81c6a37fc10d1Neil Perrin
899217dd4c82fc8ec67006fe51e81c6a37fc10d1Neil Perrin/* For http_core.c... (<Directory> command and virtual hosts) */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
899217dd4c82fc8ec67006fe51e81c6a37fc10d1Neil Perrinint ap_parse_htaccess(void **result, request_rec *r, int override,
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick const char *path, const char *access_name);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickCORE_EXPORT(const char *) ap_init_virtual_host(ap_pool_t *p, const char *hostname,
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick server_rec *main_server, server_rec **);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickvoid ap_process_resource_config(server_rec *s, const char *fname, ap_pool_t *p, ap_pool_t *ptemp);
899217dd4c82fc8ec67006fe51e81c6a37fc10d1Neil Perrin
899217dd4c82fc8ec67006fe51e81c6a37fc10d1Neil Perrin/* Module-method dispatchers, also for http_request.c */
899217dd4c82fc8ec67006fe51e81c6a37fc10d1Neil Perrin
899217dd4c82fc8ec67006fe51e81c6a37fc10d1Neil Perrinint ap_translate_name(request_rec *);
899217dd4c82fc8ec67006fe51e81c6a37fc10d1Neil Perrinint ap_check_user_id(request_rec *); /* obtain valid username from client auth */
67bd71c6cc629bab3aa0d595c624a667f1574254perrinint ap_invoke_handler(request_rec *);
d48e086f569202b5e178a2f514b8bd9d44c7efe2Neil Perrin
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick/* for mod_perl */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickCORE_EXPORT(const command_rec *) ap_find_command(const char *name, const command_rec *cmds);
13f5297e5400a2e850504176ad8f4a435f7f2452perrinCORE_EXPORT(const command_rec *) ap_find_command_in_modules(const char *cmd_name, module **mod);
fa9e4066f08beec538e775443c5be79dd423fcabahrensCORE_EXPORT(void *) ap_set_config_vectors(cmd_parms *parms, void *config, module *mod);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwickCORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l);
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick#endif
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick
fa9e4066f08beec538e775443c5be79dd423fcabahrens /* Hooks */
fa9e4066f08beec538e775443c5be79dd423fcabahrensDECLARE_HOOK(int,header_parser,(request_rec *))
fa9e4066f08beec538e775443c5be79dd423fcabahrensDECLARE_HOOK(void,post_config,
fa9e4066f08beec538e775443c5be79dd423fcabahrens (ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp,server_rec *s))
fa9e4066f08beec538e775443c5be79dd423fcabahrensDECLARE_HOOK(void,open_logs,
fa9e4066f08beec538e775443c5be79dd423fcabahrens (ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp,server_rec *s))
fa9e4066f08beec538e775443c5be79dd423fcabahrensDECLARE_HOOK(void,child_init,(ap_pool_t *pchild, server_rec *s))
c5c6ffa0498b9c8555798756141b4a3061a138c1maybee
c5c6ffa0498b9c8555798756141b4a3061a138c1maybee#ifdef __cplusplus
fa9e4066f08beec538e775443c5be79dd423fcabahrens}
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* !APACHE_HTTP_CONFIG_H */
fa9e4066f08beec538e775443c5be79dd423fcabahrens