mod_proxy.h revision 7f4a72152dcbb1b8fcedf85113ac18806a807627
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny/* Copyright 1999-2004 The Apache Software Foundation
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny *
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Licensed under the Apache License, Version 2.0 (the "License");
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * you may not use this file except in compliance with the License.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * You may obtain a copy of the License at
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny *
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * http://www.apache.org/licenses/LICENSE-2.0
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny *
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Unless required by applicable law or agreed to in writing, software
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * distributed under the License is distributed on an "AS IS" BASIS,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * See the License for the specific language governing permissions and
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * limitations under the License.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#ifndef MOD_PROXY_H
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#define MOD_PROXY_H
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny/*
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Main include file for the Apache proxy
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny/*
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny Also note numerous FIXMEs and CHECKMEs which should be eliminated.
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce This code is once again experimental!
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce Things to do:
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny 1. Make it completely work (for FTP too)
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny 2. HTTP/1.1
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny Chuck Murcko <chuck@topsail.org> 02-06-01
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#define CORE_PRIVATE
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_hooks.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_lib.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_strings.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_buckets.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_md5.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_network_io.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_pools.h"
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#include "apr_strings.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_uri.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_date.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_strmatch.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_fnmatch.h"
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#define APR_WANT_STRFUNC
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "apr_want.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "httpd.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "http_config.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "ap_config.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "http_core.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "http_protocol.h"
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#include "http_request.h"
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#include "http_vhost.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "http_main.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "http_log.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "http_connection.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "util_filter.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#include "util_ebcdic.h"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#if APR_HAVE_NETINET_IN_H
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#include <netinet/in.h>
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#endif
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#if APR_HAVE_ARPA_INET_H
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#include <arpa/inet.h>
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#endif
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce
7fe69bb6ec70bce439c6b975a9a0044c98ff502bSimo Sorce/* for proxy_canonenc() */
7fe69bb6ec70bce439c6b975a9a0044c98ff502bSimo Sorceenum enctype {
7fe69bb6ec70bce439c6b975a9a0044c98ff502bSimo Sorce enc_path, enc_search, enc_user, enc_fpath, enc_parm
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny};
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#if APR_CHARSET_EBCDIC
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#define CRLF "\r\n"
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#else /*APR_CHARSET_EBCDIC*/
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#define CRLF "\015\012"
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny#endif /*APR_CHARSET_EBCDIC*/
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce/* default Max-Forwards header setting */
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce#define DEFAULT_MAX_FORWARDS 10
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce/* static information about a remote proxy */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zelenystruct proxy_remote {
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce const char *scheme; /* the schemes handled by this proxy, or '*' */
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce const char *protocol; /* the scheme used to talk to this proxy */
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce const char *hostname; /* the hostname of this proxy */
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce apr_port_t port; /* the port for this proxy */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny regex_t *regexp; /* compiled regex (if any) for the remote */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny int use_regex; /* simple boolean. True if we have a regex pattern */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny};
6a8999bf933f72923a271831d85a01ef88a81f39Jakub Hrozek
6a8999bf933f72923a271831d85a01ef88a81f39Jakub Hrozekstruct proxy_alias {
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny const char *real;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny const char *fake;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny};
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zelenystruct dirconn_entry {
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny char *name;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny struct in_addr addr, mask;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny struct apr_sockaddr_t *hostaddr;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny int (*matcher) (struct dirconn_entry * This, request_rec *r);
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce};
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zelenystruct noproxy_entry {
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny const char *name;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny struct apr_sockaddr_t *addr;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny};
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zelenytypedef struct {
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce apr_array_header_t *proxies;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny apr_array_header_t *sec_proxy;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny apr_array_header_t *aliases;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny apr_array_header_t *raliases;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny apr_array_header_t *noproxies;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny apr_array_header_t *dirconn;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny apr_array_header_t *allowed_connect_ports;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny const char *domain; /* domain name to use in absence of a domain name in the request */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny int req; /* true if proxy requests are enabled */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny char req_set;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce enum {
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce via_off,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny via_on,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny via_block,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny via_full
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny } viaopt; /* how to deal with proxy Via: headers */
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce char viaopt_set;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce apr_size_t recv_buffer_size;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny char recv_buffer_size_set;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny apr_size_t io_buffer_size;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny char io_buffer_size_set;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny long maxfwd;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny char maxfwd_set;
cb388d52f49f54963379cc20a25e14d17fe6e9a3Simo Sorce /**
cb388d52f49f54963379cc20a25e14d17fe6e9a3Simo Sorce * the following setting masks the error page
cb388d52f49f54963379cc20a25e14d17fe6e9a3Simo Sorce * returned from the 'proxied server' and just
cb388d52f49f54963379cc20a25e14d17fe6e9a3Simo Sorce * forwards the status code upwards.
cb388d52f49f54963379cc20a25e14d17fe6e9a3Simo Sorce * This allows the main server (us) to generate
cb388d52f49f54963379cc20a25e14d17fe6e9a3Simo Sorce * the error page, (so it will look like a error
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * returned from the rest of the system
cb388d52f49f54963379cc20a25e14d17fe6e9a3Simo Sorce */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny int error_override;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny int error_override_set;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny int preserve_host;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny int preserve_host_set;
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce apr_interval_time_t timeout;
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce apr_interval_time_t timeout_set;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce enum {
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce bad_error,
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce bad_ignore,
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce bad_body
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce } badopt; /* how to deal with bad headers */
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce char badopt_set;
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce/* putting new stuff on the end maximises binary back-compatibility.
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * the strmatch_patterns are really a const just to have a
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * case-independent strstr.
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny apr_array_header_t* cookie_paths;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny apr_array_header_t* cookie_domains;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce const apr_strmatch_pattern* cookie_path_str;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce const apr_strmatch_pattern* cookie_domain_str;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce} proxy_server_conf;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorcetypedef struct {
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny const char *p; /* The path */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny int p_is_fnmatch; /* Is this path an fnmatch candidate? */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny regex_t *r; /* Is this a regex? */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny} proxy_dir_conf;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zelenytypedef struct {
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny conn_rec *connection;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce char *hostname;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce apr_port_t port;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce int is_ssl;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce} proxy_conn_rec;
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorcetypedef struct {
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny float cache_completion; /* completion percentage */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny int content_length; /* length of the content */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny} proxy_completion;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny/* hooks */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny/* Create a set of PROXY_DECLARE(type), PROXY_DECLARE_NONSTD(type) and
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * PROXY_DECLARE_DATA with appropriate export and import tags for the platform
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny */
3912262270a6449ebe1d3e92c27c217b4044f894Simo Sorce#if !defined(WIN32)
3912262270a6449ebe1d3e92c27c217b4044f894Simo Sorce#define PROXY_DECLARE(type) type
3912262270a6449ebe1d3e92c27c217b4044f894Simo Sorce#define PROXY_DECLARE_NONSTD(type) type
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_DECLARE_DATA
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#elif defined(PROXY_DECLARE_STATIC)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_DECLARE(type) type __stdcall
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_DECLARE_NONSTD(type) type
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_DECLARE_DATA
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#elif defined(PROXY_DECLARE_EXPORT)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_DECLARE(type) __declspec(dllexport) type __stdcall
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_DECLARE_NONSTD(type) __declspec(dllexport) type
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_DECLARE_DATA __declspec(dllexport)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#else
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_DECLARE(type) __declspec(dllimport) type __stdcall
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce#define PROXY_DECLARE_NONSTD(type) __declspec(dllimport) type
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_DECLARE_DATA __declspec(dllimport)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#endif
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny/**
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * Hook an optional proxy hook. Unlike static hooks, this uses a macro
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * instead of a function.
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#define PROXY_OPTIONAL_HOOK(name,fn,pre,succ,order) \
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny APR_OPTIONAL_HOOK(proxy,name,fn,pre,succ,order)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
3912262270a6449ebe1d3e92c27c217b4044f894Simo SorceAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, scheme_handler, (request_rec *r,
0754ff886f909f0404038eb9c99dd61be1acf5b9Simo Sorce proxy_server_conf *conf, char *url,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny const char *proxyhost, apr_port_t proxyport))
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, canon_handler, (request_rec *r,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny char *url))
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, create_req, (request_rec *r, request_rec *pr))
3912262270a6449ebe1d3e92c27c217b4044f894Simo SorceAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, fixups, (request_rec *r))
3912262270a6449ebe1d3e92c27c217b4044f894Simo Sorce
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce/* proxy_util.c */
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(int) ap_proxy_hex2c(const char *x);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(void) ap_proxy_c2hex(int ch, char *x);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t,
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce int isenc);
3912262270a6449ebe1d3e92c27c217b4044f894Simo SorcePROXY_DECLARE(char *)ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce char **passwordp, char **hostp, apr_port_t *port);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(const char *)ap_proxy_date_canon(apr_pool_t *p, const char *x);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(int) ap_proxy_liststr(const char *list, const char *val);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(char *)ap_proxy_removestr(apr_pool_t *pool, const char *list, const char *val);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(int) ap_proxy_hex2sec(const char *x);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(void) ap_proxy_sec2hex(int t, char *y);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo SorcePROXY_DECLARE(int) ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p);
3912262270a6449ebe1d3e92c27c217b4044f894Simo SorcePROXY_DECLARE(int) ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p);
3912262270a6449ebe1d3e92c27c217b4044f894Simo SorcePROXY_DECLARE(int) ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p);
7fe69bb6ec70bce439c6b975a9a0044c98ff502bSimo SorcePROXY_DECLARE(int) ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
7fe69bb6ec70bce439c6b975a9a0044c98ff502bSimo SorcePROXY_DECLARE(int) ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyPROXY_DECLARE(int) ap_proxy_pre_http_request(conn_rec *c, request_rec *r);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyPROXY_DECLARE(apr_status_t) ap_proxy_string_read(conn_rec *c, apr_bucket_brigade *bb, char *buff, size_t bufflen, int *eos);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyPROXY_DECLARE(void) ap_proxy_table_unmerge(apr_pool_t *p, apr_table_t *t, char *key);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyPROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **, const char *, apr_sockaddr_t *, const char *, proxy_server_conf *, server_rec *, apr_pool_t *);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyPROXY_DECLARE(int) ap_proxy_ssl_enable(conn_rec *c);
3912262270a6449ebe1d3e92c27c217b4044f894Simo SorcePROXY_DECLARE(int) ap_proxy_ssl_disable(conn_rec *c);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
c03b28a38b14fdb59f74864ae4dc56affe256508Simo Sorce/* For proxy_util */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zelenyextern module AP_MODULE_DECLARE_DATA proxy_module;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny#endif /*MOD_PROXY_H*/
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny