mod_proxy.h revision 05b232c7bd0b185d329bab8a30eefe1ca38bd6b8
842ae4bd224140319ae7feec1872b93dfd491143fielding/* ====================================================================
842ae4bd224140319ae7feec1872b93dfd491143fielding * The Apache Software License, Version 1.1
842ae4bd224140319ae7feec1872b93dfd491143fielding * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
842ae4bd224140319ae7feec1872b93dfd491143fielding * reserved.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * Redistribution and use in source and binary forms, with or without
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * modification, are permitted provided that the following conditions
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * 1. Redistributions of source code must retain the above copyright
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * notice, this list of conditions and the following disclaimer.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * 2. Redistributions in binary form must reproduce the above copyright
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * notice, this list of conditions and the following disclaimer in
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * the documentation and/or other materials provided with the
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * distribution.
e8f95a682820a599fe41b22977010636be5c2717jim * 3. The end-user documentation included with the redistribution,
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * if any, must include the following acknowledgment:
e8f95a682820a599fe41b22977010636be5c2717jim * "This product includes software developed by the
1747d30b98aa1bdbc43994c02cd46ab4cb9319e4fielding * Apache Software Foundation (http://www.apache.org/)."
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * Alternately, this acknowledgment may appear in the software itself,
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * if and wherever such third-party acknowledgments normally appear.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * 4. The names "Apache" and "Apache Software Foundation" must
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * not be used to endorse or promote products derived from this
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * software without prior written permission. For written
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * permission, please contact apache@apache.org.
11f2c481e1d57bedb3f758565307501e9a2730ddtrawick * 5. Products derived from this software may not be called "Apache",
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * nor may "Apache" appear in their name, without prior written
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * permission of the Apache Software Foundation.
5c0419d51818eb02045cf923a9fe456127a44c60wrowe * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
5c0419d51818eb02045cf923a9fe456127a44c60wrowe * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
d266c3777146d36a4c23c17aad6f153aebea1bf4jorton * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
d266c3777146d36a4c23c17aad6f153aebea1bf4jorton * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * SUCH DAMAGE.
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * ====================================================================
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * This software consists of voluntary contributions made by many
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * individuals on behalf of the Apache Software Foundation. For more
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * information on the Apache Software Foundation, please see
0f60998368b493f90120180a93fc2e1e74490872covener * Portions of this software are based upon public domain software
0f60998368b493f90120180a93fc2e1e74490872covener * originally written at the National Center for Supercomputing Applications,
0f60998368b493f90120180a93fc2e1e74490872covener * University of Illinois, Urbana-Champaign.
87587593f1a53030e840acc0dec6cc881022ea40covener * Main include file for the Apache proxy
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes Also note numerous FIXMEs and CHECKMEs which should be eliminated.
0568280364eb026393be492ebc732795c4934643jorton This code is once again experimental!
0568280364eb026393be492ebc732795c4934643jorton Things to do:
0568280364eb026393be492ebc732795c4934643jorton 1. Make it completely work (for FTP too)
0568280364eb026393be492ebc732795c4934643jorton 2. HTTP/1.1
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes Chuck Murcko <chuck@topsail.org> 02-06-01
482f676c6c19b1c5bb5cca04dad11509c1da3a4cwrowe/* for proxy_canonenc() */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes enc_path, enc_search, enc_user, enc_fpath, enc_parm
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#else /*APR_CHARSET_EBCDIC*/
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif /*APR_CHARSET_EBCDIC*/
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes/* static information about a remote proxy */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes const char *scheme; /* the schemes handled by this proxy, or '*' */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes const char *protocol; /* the scheme used to talk to this proxy */
8113dac419143273351446c3ad653f3fe5ba5cfdwrowe const char *hostname; /* the hostname of this proxy */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes const char *real;
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes const char *fake;
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes int (*matcher) (struct dirconn_entry * This, request_rec *r);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener const char *name;
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholestypedef struct {
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes const char *domain; /* domain name to use in absence of a domain name in the request */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes } viaopt; /* how to deal with proxy Via: headers */
1f299703465bd9975d94e9f229f76af807442de2covenertypedef struct {
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholestypedef struct {
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes float cache_completion; /* completion percentage */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes/* Function prototypes */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesint ap_proxy_connect_handler(request_rec *r, char *url,
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesint ap_proxy_ftp_handler(request_rec *r, char *url);
3e6d7277b90d3011db832139afc20efb5f17e203rederpjapr_status_t ap_proxy_send_dir_filter(ap_filter_t *f,
e8f95a682820a599fe41b22977010636be5c2717jimint ap_proxy_http_canon(request_rec *r, char *url, const char *scheme,
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerrequest_rec *make_fake_req(conn_rec *c, request_rec *r);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxy_hex2c(const char *x);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerchar *ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t,
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerchar *ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerconst char *ap_proxy_date_canon(apr_pool_t *p, const char *x);
6683642c1e0032eeeed5f99e8c14880692ef84c5sfapr_table_t *ap_proxy_read_headers(request_rec *r, request_rec *rp, char *buffer, int size, conn_rec *c);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxy_liststr(const char *list, const char *val);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerchar *ap_proxy_removestr(apr_pool_t *pool, const char *list, const char *val);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxy_hex2sec(const char *x);
6683642c1e0032eeeed5f99e8c14880692ef84c5sfvoid ap_proxy_sec2hex(int t, char *y);
6683642c1e0032eeeed5f99e8c14880692ef84c5sfconst char *ap_proxy_host2addr(const char *host, struct hostent *reqhp);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxyerror(request_rec *r, int statuscode, const char *message);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerint ap_proxy_pre_http_connection(conn_rec *c, request_rec *r);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerapr_status_t ap_proxy_string_read(conn_rec *c, apr_bucket_brigade *bb, char *buff, size_t bufflen, int *eos);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#endif /*MOD_PROXY_H*/