mod_proxy.h revision 3c59b18ce62f97468aaa5951d4e21a5478ef36ec
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb/* ====================================================================
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * The Apache Software License, Version 1.1
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * reserved.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Redistribution and use in source and binary forms, with or without
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * modification, are permitted provided that the following conditions
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * are met:
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * 1. Redistributions of source code must retain the above copyright
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * notice, this list of conditions and the following disclaimer.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * 2. Redistributions in binary form must reproduce the above copyright
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * notice, this list of conditions and the following disclaimer in
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * the documentation and/or other materials provided with the
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * distribution.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * 3. The end-user documentation included with the redistribution,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * if any, must include the following acknowledgment:
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * "This product includes software developed by the
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Apache Software Foundation (http://www.apache.org/)."
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Alternately, this acknowledgment may appear in the software itself,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * if and wherever such third-party acknowledgments normally appear.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * 4. The names "Apache" and "Apache Software Foundation" must
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * not be used to endorse or promote products derived from this
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * software without prior written permission. For written
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * permission, please contact apache@apache.org.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * 5. Products derived from this software may not be called "Apache",
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * nor may "Apache" appear in their name, without prior written
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * permission of the Apache Software Foundation.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * SUCH DAMAGE.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * ====================================================================
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * This software consists of voluntary contributions made by many
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * individuals on behalf of the Apache Software Foundation. For more
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * information on the Apache Software Foundation, please see
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Portions of this software are based upon public domain software
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * originally written at the National Center for Supercomputing Applications,
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * University of Illinois, Urbana-Champaign.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb * Main include file for the Apache proxy
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb Also note numerous FIXMEs and CHECKMEs which should be eliminated.
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb This code is once again experimental!
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb Things to do:
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb 1. Make it completely work (for FTP too)
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb 2. HTTP/1.1
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb Chuck Murcko <chuck@topsail.org> 02-06-01
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe/* for proxy_canonenc() */
731344ed8f3677d1661c261ca5fcdd2ee3dbc74ccoar#else /*APR_CHARSET_EBCDIC*/
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe#endif /*APR_CHARSET_EBCDIC*/
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe#define DEFAULT_PROSPERO_PORT 1525 /* WARNING: conflict w/Oracle */
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe/* Some WWW schemes and their default ports; this is basically /etc/services */
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe const char *scheme;
3e392a5afd51526de3cb15d57ee46d8cb160ae65gregames/* static information about a remote proxy */
731344ed8f3677d1661c261ca5fcdd2ee3dbc74ccoar const char *scheme; /* the schemes handled by this proxy, or '*' */
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe const char *protocol; /* the scheme used to talk to this proxy */
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe const char *hostname; /* the hostname of this proxy */
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe const char *real;
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe const char *fake;
c2cf53a40a9814eb91db2cdf820f97d943f21628coar int (*matcher) (struct dirconn_entry * This, request_rec *r);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe const char *name;
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowetypedef struct {
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe const char *connectname;
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe const char *domain; /* domain name to use in absence of a domain name in the request */
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowetypedef struct {
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe/* Function prototypes */
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wroweint ap_proxy_connect_handler(request_rec *r, char *url,
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wroweapr_status_t ap_proxy_send_dir_filter(ap_filter_t *f, apr_bucket_brigade *bb, ap_input_mode_t mode);
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wroweint ap_proxy_http_canon(request_rec *r, char *url, const char *scheme,
c2cf53a40a9814eb91db2cdf820f97d943f21628coarrequest_rec *make_fake_req(conn_rec *c, request_rec *r);
c2cf53a40a9814eb91db2cdf820f97d943f21628coarint ap_proxy_hex2c(const char *x);
c2cf53a40a9814eb91db2cdf820f97d943f21628coarchar *ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t,
c2cf53a40a9814eb91db2cdf820f97d943f21628coarchar *ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
c2cf53a40a9814eb91db2cdf820f97d943f21628coarconst char *ap_proxy_date_canon(apr_pool_t *p, const char *x);
c2cf53a40a9814eb91db2cdf820f97d943f21628coarapr_table_t *ap_proxy_read_headers(request_rec *r, request_rec *rp, char *buffer, int size, conn_rec *c);
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wroweint ap_proxy_liststr(const char *list, const char *val);
c2cf53a40a9814eb91db2cdf820f97d943f21628coarchar *ap_proxy_removestr(apr_pool_t *pool, const char *list, const char *val);
c2cf53a40a9814eb91db2cdf820f97d943f21628coarint ap_proxy_hex2sec(const char *x);
c2cf53a40a9814eb91db2cdf820f97d943f21628coarvoid ap_proxy_sec2hex(int t, char *y);
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wroweconst char *ap_proxy_host2addr(const char *host, struct hostent *reqhp);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweint ap_proxyerror(request_rec *r, int statuscode, const char *message);
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wroweint ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweint ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweint ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweint ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewroweint ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr);
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe#endif /*MOD_PROXY_H*/