00001 /* Copyright 1999-2005 The Apache Software Foundation or its licensors, as 00002 * applicable. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef APACHE_HTTP_VHOST_H 00018 #define APACHE_HTTP_VHOST_H 00019 00020 #ifdef __cplusplus 00021 extern "C" { 00022 #endif 00023 00024 /** 00025 * @package Virtual Host package 00026 */ 00027 00028 /** 00029 * called before any config is read 00030 * @param p Pool to allocate out of 00031 */ 00032 AP_DECLARE(void) ap_init_vhost_config(apr_pool_t *p); 00033 00034 /** 00035 * called after the config has been read to compile the tables needed to do 00036 * the run-time vhost lookups 00037 * @param p The pool to allocate out of 00038 * @param main_server The start of the virtual host list 00039 * @deffunc ap_fini_vhost_config(apr_pool_t *p, server_rec *main_server) 00040 */ 00041 AP_DECLARE(void) ap_fini_vhost_config(apr_pool_t *p, server_rec *main_server); 00042 00043 /** 00044 * handle addresses in <VirtualHost> statement 00045 * @param p The pool to allocate out of 00046 * @param hostname The hostname in the VirtualHost statement 00047 * @param s The list of Virtual Hosts. 00048 */ 00049 const char *ap_parse_vhost_addrs(apr_pool_t *p, const char *hostname, server_rec *s); 00050 00051 /* handle NameVirtualHost directive */ 00052 const char *ap_set_name_virtual_host (cmd_parms *cmd, void *dummy, 00053 const char *arg); 00054 00055 /** 00056 * given an ip address only, give our best guess as to what vhost it is 00057 * @param conn The current connection 00058 */ 00059 AP_DECLARE(void) ap_update_vhost_given_ip(conn_rec *conn); 00060 00061 /** 00062 * ap_update_vhost_given_ip is never enough, and this is always called after 00063 * the headers have been read. It may change r->server. 00064 * @param r The current request 00065 */ 00066 AP_DECLARE(void) ap_update_vhost_from_headers(request_rec *r); 00067 00068 /** 00069 * Match the host in the header with the hostname of the server for this 00070 * request. 00071 * @param r The current request 00072 * @param host The hostname in the headers 00073 * @param port The port from the headers 00074 * @return return 1 if the host:port matches any of the aliases of r->server, 00075 * return 0 otherwise 00076 * @deffunc int ap_matches_request_vhost(request_rec *r, const char *host, apr_port_t port) 00077 */ 00078 AP_DECLARE(int) ap_matches_request_vhost(request_rec *r, const char *host, 00079 apr_port_t port); 00080 00081 #ifdef __cplusplus 00082 } 00083 #endif 00084 00085 #endif /* !APACHE_HTTP_VHOST_H */