mod_proxy.h revision 4a7df15077ff65dbf3b2cf68fa3063273ac0a547
af84459fbf938e508fd10b01cb8d699c79083813takashi/* ====================================================================
af84459fbf938e508fd10b01cb8d699c79083813takashi * The Apache Software License, Version 1.1
af84459fbf938e508fd10b01cb8d699c79083813takashi * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
af84459fbf938e508fd10b01cb8d699c79083813takashi * reserved.
af84459fbf938e508fd10b01cb8d699c79083813takashi * Redistribution and use in source and binary forms, with or without
af84459fbf938e508fd10b01cb8d699c79083813takashi * modification, are permitted provided that the following conditions
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * 1. Redistributions of source code must retain the above copyright
2e545ce2450a9953665f701bb05350f0d3f26275nd * notice, this list of conditions and the following disclaimer.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * 2. Redistributions in binary form must reproduce the above copyright
af84459fbf938e508fd10b01cb8d699c79083813takashi * notice, this list of conditions and the following disclaimer in
af84459fbf938e508fd10b01cb8d699c79083813takashi * the documentation and/or other materials provided with the
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen * distribution.
af84459fbf938e508fd10b01cb8d699c79083813takashi * 3. The end-user documentation included with the redistribution,
af84459fbf938e508fd10b01cb8d699c79083813takashi * if any, must include the following acknowledgment:
af84459fbf938e508fd10b01cb8d699c79083813takashi * "This product includes software developed by the
3f08db06526d6901aa08c110b5bc7dde6bc39905nd * Apache Software Foundation (http://www.apache.org/)."
af84459fbf938e508fd10b01cb8d699c79083813takashi * Alternately, this acknowledgment may appear in the software itself,
af84459fbf938e508fd10b01cb8d699c79083813takashi * if and wherever such third-party acknowledgments normally appear.
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung * 4. The names "Apache" and "Apache Software Foundation" must
af84459fbf938e508fd10b01cb8d699c79083813takashi * not be used to endorse or promote products derived from this
af84459fbf938e508fd10b01cb8d699c79083813takashi * software without prior written permission. For written
af84459fbf938e508fd10b01cb8d699c79083813takashi * permission, please contact apache@apache.org.
af84459fbf938e508fd10b01cb8d699c79083813takashi * 5. Products derived from this software may not be called "Apache",
3c13a815670b54d1c17bf02954f7d2b066cde95cnd * nor may "Apache" appear in their name, without prior written
3c13a815670b54d1c17bf02954f7d2b066cde95cnd * permission of the Apache Software Foundation.
af84459fbf938e508fd10b01cb8d699c79083813takashi * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
af84459fbf938e508fd10b01cb8d699c79083813takashi * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
af84459fbf938e508fd10b01cb8d699c79083813takashi * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5effc8b39fae5cd169d17f342bfc265705840014rbowen * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
5effc8b39fae5cd169d17f342bfc265705840014rbowen * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
5effc8b39fae5cd169d17f342bfc265705840014rbowen * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
5effc8b39fae5cd169d17f342bfc265705840014rbowen * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
af84459fbf938e508fd10b01cb8d699c79083813takashi * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
af84459fbf938e508fd10b01cb8d699c79083813takashi * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
af84459fbf938e508fd10b01cb8d699c79083813takashi * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
af84459fbf938e508fd10b01cb8d699c79083813takashi * SUCH DAMAGE.
af84459fbf938e508fd10b01cb8d699c79083813takashi * ====================================================================
5effc8b39fae5cd169d17f342bfc265705840014rbowen * This software consists of voluntary contributions made by many
5effc8b39fae5cd169d17f342bfc265705840014rbowen * individuals on behalf of the Apache Software Foundation. For more
5effc8b39fae5cd169d17f342bfc265705840014rbowen * information on the Apache Software Foundation, please see
5effc8b39fae5cd169d17f342bfc265705840014rbowen * Portions of this software are based upon public domain software
5effc8b39fae5cd169d17f342bfc265705840014rbowen * originally written at the National Center for Supercomputing Applications,
5effc8b39fae5cd169d17f342bfc265705840014rbowen * University of Illinois, Urbana-Champaign.
5effc8b39fae5cd169d17f342bfc265705840014rbowen * Main include file for the Apache proxy
5effc8b39fae5cd169d17f342bfc265705840014rbowen Also note numerous FIXMEs and CHECKMEs which should be eliminated.
5effc8b39fae5cd169d17f342bfc265705840014rbowen This code is once again experimental!
1c26a593f62800795eddc6cbaf86090e0976e2efrbowen Things to do:
5effc8b39fae5cd169d17f342bfc265705840014rbowen 1. Make it completely work (for FTP too)
5effc8b39fae5cd169d17f342bfc265705840014rbowen 2. HTTP/1.1
5effc8b39fae5cd169d17f342bfc265705840014rbowen Chuck Murcko <chuck@topsail.org> 02-06-01
5effc8b39fae5cd169d17f342bfc265705840014rbowen/* for proxy_canonenc() */
5effc8b39fae5cd169d17f342bfc265705840014rbowen#else /*APR_CHARSET_EBCDIC*/
5effc8b39fae5cd169d17f342bfc265705840014rbowen#endif /*APR_CHARSET_EBCDIC*/
5effc8b39fae5cd169d17f342bfc265705840014rbowen/* default Max-Forwards header setting */
5effc8b39fae5cd169d17f342bfc265705840014rbowen/* static information about a remote proxy */
5effc8b39fae5cd169d17f342bfc265705840014rbowen const char *scheme; /* the schemes handled by this proxy, or '*' */
5effc8b39fae5cd169d17f342bfc265705840014rbowen const char *protocol; /* the scheme used to talk to this proxy */
5effc8b39fae5cd169d17f342bfc265705840014rbowen const char *hostname; /* the hostname of this proxy */
5effc8b39fae5cd169d17f342bfc265705840014rbowen const char *real;
5effc8b39fae5cd169d17f342bfc265705840014rbowen const char *fake;
5effc8b39fae5cd169d17f342bfc265705840014rbowen int (*matcher) (struct dirconn_entry * This, request_rec *r);
5effc8b39fae5cd169d17f342bfc265705840014rbowen const char *name;
5effc8b39fae5cd169d17f342bfc265705840014rbowentypedef struct {
5effc8b39fae5cd169d17f342bfc265705840014rbowen const char *domain; /* domain name to use in absence of a domain name in the request */
5effc8b39fae5cd169d17f342bfc265705840014rbowen * the following setting masks the error page
5effc8b39fae5cd169d17f342bfc265705840014rbowen * returned from the 'proxied server' and just
5effc8b39fae5cd169d17f342bfc265705840014rbowen * forwards the status code upwards.
5effc8b39fae5cd169d17f342bfc265705840014rbowen * This allows the main server (us) to generate
5effc8b39fae5cd169d17f342bfc265705840014rbowen * the error page, (so it will look like a error
5effc8b39fae5cd169d17f342bfc265705840014rbowen * returned from the rest of the system
5effc8b39fae5cd169d17f342bfc265705840014rbowentypedef struct {
5effc8b39fae5cd169d17f342bfc265705840014rbowen const char *p; /* The path */
5effc8b39fae5cd169d17f342bfc265705840014rbowen int p_is_fnmatch; /* Is this path an fnmatch candidate? */
63befe0983261d711e62457b380e24ecc3b7b79etrawicktypedef struct {
5effc8b39fae5cd169d17f342bfc265705840014rbowentypedef struct {
5effc8b39fae5cd169d17f342bfc265705840014rbowen/* Create a set of PROXY_DECLARE(type), PROXY_DECLARE_NONSTD(type) and
5effc8b39fae5cd169d17f342bfc265705840014rbowen * PROXY_DECLARE_DATA with appropriate export and import tags for the platform
5effc8b39fae5cd169d17f342bfc265705840014rbowen#if !defined(WIN32)
5effc8b39fae5cd169d17f342bfc265705840014rbowen#define PROXY_DECLARE(type) __declspec(dllexport) type __stdcall
5effc8b39fae5cd169d17f342bfc265705840014rbowen#define PROXY_DECLARE_NONSTD(type) __declspec(dllexport) type
5effc8b39fae5cd169d17f342bfc265705840014rbowen#define PROXY_DECLARE(type) __declspec(dllimport) type __stdcall
5effc8b39fae5cd169d17f342bfc265705840014rbowen#define PROXY_DECLARE_NONSTD(type) __declspec(dllimport) type
5effc8b39fae5cd169d17f342bfc265705840014rbowenAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, scheme_handler, (request_rec *r,
af84459fbf938e508fd10b01cb8d699c79083813takashiAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, canon_handler, (request_rec *r,
5effc8b39fae5cd169d17f342bfc265705840014rbowenPROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r);
5effc8b39fae5cd169d17f342bfc265705840014rbowenPROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t,
af84459fbf938e508fd10b01cb8d699c79083813takashiPROXY_DECLARE(char *)ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
af84459fbf938e508fd10b01cb8d699c79083813takashiPROXY_DECLARE(const char *)ap_proxy_date_canon(apr_pool_t *p, const char *x);
af84459fbf938e508fd10b01cb8d699c79083813takashiPROXY_DECLARE(apr_table_t *)ap_proxy_read_headers(request_rec *r, request_rec *rp, char *buffer, int size, conn_rec *c);
af84459fbf938e508fd10b01cb8d699c79083813takashiPROXY_DECLARE(int) ap_proxy_liststr(const char *list, const char *val);
af84459fbf938e508fd10b01cb8d699c79083813takashiPROXY_DECLARE(char *)ap_proxy_removestr(apr_pool_t *pool, const char *list, const char *val);
af84459fbf938e508fd10b01cb8d699c79083813takashiPROXY_DECLARE(void) ap_proxy_sec2hex(int t, char *y);
5effc8b39fae5cd169d17f342bfc265705840014rbowenPROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message);
af84459fbf938e508fd10b01cb8d699c79083813takashiPROXY_DECLARE(int) ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p);
af84459fbf938e508fd10b01cb8d699c79083813takashiPROXY_DECLARE(int) ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p);
5effc8b39fae5cd169d17f342bfc265705840014rbowenPROXY_DECLARE(int) ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p);
5effc8b39fae5cd169d17f342bfc265705840014rbowenPROXY_DECLARE(int) ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
5effc8b39fae5cd169d17f342bfc265705840014rbowenPROXY_DECLARE(int) ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr);
5effc8b39fae5cd169d17f342bfc265705840014rbowenPROXY_DECLARE(int) ap_proxy_pre_http_connection(conn_rec *c, request_rec *r);
5effc8b39fae5cd169d17f342bfc265705840014rbowenPROXY_DECLARE(apr_status_t) ap_proxy_string_read(conn_rec *c, apr_bucket_brigade *bb, char *buff, size_t bufflen, int *eos);
5effc8b39fae5cd169d17f342bfc265705840014rbowenPROXY_DECLARE(void) ap_proxy_reset_output_filters(conn_rec *c);
5effc8b39fae5cd169d17f342bfc265705840014rbowen#endif /*MOD_PROXY_H*/