mod_proxy.h revision af952917c05e56874069e1e5f64e6473bb478b68
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/* ====================================================================
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * The Apache Software License, Version 1.1
b99dbaab171d91e1b664397cc40e039d0c087c65fielding * Copyright (c) 2000 The Apache Software Foundation. All rights
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * reserved.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Redistribution and use in source and binary forms, with or without
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * modification, are permitted provided that the following conditions
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * 1. Redistributions of source code must retain the above copyright
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * notice, this list of conditions and the following disclaimer.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * 2. Redistributions in binary form must reproduce the above copyright
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * notice, this list of conditions and the following disclaimer in
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * the documentation and/or other materials provided with the
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * distribution.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * 3. The end-user documentation included with the redistribution,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * if any, must include the following acknowledgment:
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * "This product includes software developed by the
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * Apache Software Foundation (http://www.apache.org/)."
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * Alternately, this acknowledgment may appear in the software itself,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * if and wherever such third-party acknowledgments normally appear.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * 4. The names "Apache" and "Apache Software Foundation" must
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * not be used to endorse or promote products derived from this
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * software without prior written permission. For written
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * permission, please contact apache@apache.org.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * 5. Products derived from this software may not be called "Apache",
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * nor may "Apache" appear in their name, without prior written
64185f9824e42f21ca7b9ae6c004484215c031a7rbb * permission of the Apache Software Foundation.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * SUCH DAMAGE.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * ====================================================================
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * This software consists of voluntary contributions made by many
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * individuals on behalf of the Apache Software Foundation. For more
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * information on the Apache Software Foundation, please see
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * Portions of this software are based upon public domain software
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * originally written at the National Center for Supercomputing Applications,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding * University of Illinois, Urbana-Champaign.
3568de757bac0b47256647504c186d17ca272f85rbb * Main include file for the Apache proxy
3568de757bac0b47256647504c186d17ca272f85rbb Note that the Explain() stuff is not yet complete.
3568de757bac0b47256647504c186d17ca272f85rbb Also note numerous FIXMEs and CHECKMEs which should be eliminated.
3568de757bac0b47256647504c186d17ca272f85rbb If TESTING is set, then garbage collection doesn't delete ... probably a good
3568de757bac0b47256647504c186d17ca272f85rbb idea when hacking.
3568de757bac0b47256647504c186d17ca272f85rbb This code is once again experimental!
3568de757bac0b47256647504c186d17ca272f85rbb Things to do:
3568de757bac0b47256647504c186d17ca272f85rbb 1. Make it completely work (for FTP too)
3568de757bac0b47256647504c186d17ca272f85rbb 2. HTTP/1.1
3568de757bac0b47256647504c186d17ca272f85rbb 3. Cache issues
3568de757bac0b47256647504c186d17ca272f85rbb Chuck Murcko <chuck@topsail.org> 02-06-01
3568de757bac0b47256647504c186d17ca272f85rbb/* for proxy_canonenc() */
3568de757bac0b47256647504c186d17ca272f85rbb#define HDR_APP (0) /* append header, for proxy_add_header() */
3568de757bac0b47256647504c186d17ca272f85rbb#define HDR_REP (1) /* replace header, for proxy_add_header() */
3568de757bac0b47256647504c186d17ca272f85rbb#else /*APR_CHARSET_EBCDIC*/
3568de757bac0b47256647504c186d17ca272f85rbb#endif /*APR_CHARSET_EBCDIC*/
8f3ec4772d2aeb347cf40e87c77627bb784dd018rbb#define DEFAULT_PROSPERO_PORT 1525 /* WARNING: conflict w/Oracle */
3568de757bac0b47256647504c186d17ca272f85rbb/* Some WWW schemes and their default ports; this is basically /etc/services */
3568de757bac0b47256647504c186d17ca272f85rbb const char *scheme;
3568de757bac0b47256647504c186d17ca272f85rbb/* static information about a remote proxy */
3568de757bac0b47256647504c186d17ca272f85rbb const char *scheme; /* the schemes handled by this proxy, or '*' */
3568de757bac0b47256647504c186d17ca272f85rbb const char *protocol; /* the scheme used to talk to this proxy */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding const char *real;
3568de757bac0b47256647504c186d17ca272f85rbb const char *fake;
3568de757bac0b47256647504c186d17ca272f85rbb int (*matcher) (struct dirconn_entry * This, request_rec *r);
3568de757bac0b47256647504c186d17ca272f85rbb const char *name;
3568de757bac0b47256647504c186d17ca272f85rbb const char *name;
3568de757bac0b47256647504c186d17ca272f85rbbtypedef struct {
78ae889ffe0fdfab72f56c6993b0f302cb48da55rbb const char *domain; /* domain name to use in absence of a domain name in the request */
0375f54d32af9c27de0006956d9f85d01b020351stoddard float cache_completion; /* Force cache completion after this point */
3568de757bac0b47256647504c186d17ca272f85rbbtypedef struct {
3568de757bac0b47256647504c186d17ca272f85rbb/* Function prototypes */
3568de757bac0b47256647504c186d17ca272f85rbbint ap_proxy_ftp_handler(request_rec *r, ap_cache_el *c, char *url);
3568de757bac0b47256647504c186d17ca272f85rbbint ap_proxy_http_canon(request_rec *r, char *url, const char *scheme,
78ae889ffe0fdfab72f56c6993b0f302cb48da55rbbint ap_proxy_hex2c(const char *x);
3568de757bac0b47256647504c186d17ca272f85rbbchar *ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t,
3568de757bac0b47256647504c186d17ca272f85rbbchar *ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
41634f717c623556a16b27b25d7d909a66fe20f8wroweconst char *ap_proxy_date_canon(apr_pool_t *p, const char *x);
41634f717c623556a16b27b25d7d909a66fe20f8wroweapr_table_t *ap_proxy_read_headers(request_rec *r, char *buffer, int size, conn_rec *c);
3568de757bac0b47256647504c186d17ca272f85rbbvoid ap_proxy_send_headers(request_rec *r, const char *respline, apr_table_t *hdrs);
ad83978f20c7d1a4323059d9af122e56fcd353bdstoddardint ap_proxy_liststr(const char *list, const char *val);
3568de757bac0b47256647504c186d17ca272f85rbbvoid ap_proxy_hash(const char *it, char *val, int ndepth, int nlength);
3568de757bac0b47256647504c186d17ca272f85rbbint ap_proxy_hex2sec(const char *x);
3568de757bac0b47256647504c186d17ca272f85rbbvoid ap_proxy_sec2hex(int t, char *y);
3568de757bac0b47256647504c186d17ca272f85rbbconst char *ap_proxy_host2addr(const char *host, struct hostent *reqhp);
3568de757bac0b47256647504c186d17ca272f85rbbint ap_proxy_cache_should_cache(request_rec *r, apr_table_t *resp_hdrs,
3568de757bac0b47256647504c186d17ca272f85rbb const int is_HTTP1);
aa616c3b5a4aa59867472cddf7d8e63693808f0erederpjint ap_proxyerror(request_rec *r, int statuscode, const char *message);
3568de757bac0b47256647504c186d17ca272f85rbbint ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p);
42b95445a3e9b563e716503b91df6b433f9fb29agregamesint ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p);
3568de757bac0b47256647504c186d17ca272f85rbbint ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p);
3568de757bac0b47256647504c186d17ca272f85rbbint ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingapr_status_t ap_proxy_doconnect(apr_socket_t *sock, char *host, apr_uint32_t port, request_rec *r);
ca53a74f4012a45cbad48e940eddf27d866981f9dougm/* This function is called by ap_table_do() for all header lines */
ca53a74f4012a45cbad48e940eddf27d866981f9dougmint ap_proxy_send_hdr_line(void *p, const char *key, const char *value);
ca53a74f4012a45cbad48e940eddf27d866981f9dougmunsigned ap_proxy_bputs2(const char *data, apr_socket_t *client, ap_cache_el *cache);
3568de757bac0b47256647504c186d17ca272f85rbb#endif /*MOD_PROXY_H*/