00001 /** @file 00002 00003 A brief file description 00004 00005 @section license License 00006 00007 Licensed to the Apache Software Foundation (ASF) under one 00008 or more contributor license agreements. See the NOTICE file 00009 distributed with this work for additional information 00010 regarding copyright ownership. The ASF licenses this file 00011 to you under the Apache License, Version 2.0 (the 00012 "License"); you may not use this file except in compliance 00013 with the License. You may obtain a copy of the License at 00014 00015 http://www.apache.org/licenses/LICENSE-2.0 00016 00017 Unless required by applicable law or agreed to in writing, software 00018 distributed under the License is distributed on an "AS IS" BASIS, 00019 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00020 See the License for the specific language governing permissions and 00021 limitations under the License. 00022 */ 00023 00024 /***************************************************************************** 00025 * 00026 * ReverseProxy.h - Interface to code necessary for Reverse Proxy 00027 * (which mostly consists of general purpose 00028 * hostname substitution in URLs) 00029 * 00030 * 00031 ****************************************************************************/ 00032 00033 #ifndef _REVERSE_PROXY_H_ 00034 #define _REVERSE_PROXY_H_ 00035 00036 #include "P_RecProcess.h" 00037 00038 #include "ink_hash_table.h" 00039 #include "ink_defs.h" 00040 #include "HttpTransact.h" 00041 #include "RemapPluginInfo.h" 00042 #include "UrlRewrite.h" 00043 #include "UrlMapping.h" 00044 00045 #define EMPTY_PORT_MAPPING (int32_t)~0 00046 00047 class url_mapping; 00048 struct host_hdr_info; 00049 00050 // Variables for the CDN URL Remapping Feature 00051 extern int url_remap_mode; 00052 00053 extern UrlRewrite *rewrite_table; 00054 extern remap_plugin_info *remap_pi_list; 00055 00056 // API Functions 00057 int init_reverse_proxy(); 00058 00059 // Both Return true if a remapping was made and false otherwise 00060 // ebalsa@ Y! -- this happens in the remapProcessor now for the reverse proxy case (not CDN or BlindTunnel) 00061 bool request_url_remap(HttpTransact::State *s, HTTPHdr *request_header, char **redirect_url, 00062 unsigned int filter_mask = URL_REMAP_FILTER_NONE); 00063 00064 mapping_type request_url_remap_redirect(HTTPHdr *request_header, URL *redirect_url); 00065 bool response_url_remap(HTTPHdr *response_header); 00066 00067 // Reload Functions 00068 void reloadUrlRewrite(); 00069 00070 int url_rewrite_CB(const char *name, RecDataT data_type, RecData data, void *cookie); 00071 00072 #endif