1 /* Copyright 1999-2004 The Apache Software Foundation
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef APACHE_HTTP_VHOST_H
17 #define APACHE_HTTP_VHOST_H
24 * @package Virtual Host package
28 * called before any config is read
29 * @param p Pool to allocate out of
31 AP_DECLARE(void) ap_init_vhost_config(apr_pool_t *p);
34 * called after the config has been read to compile the tables needed to do
35 * the run-time vhost lookups
36 * @param p The pool to allocate out of
37 * @param main_server The start of the virtual host list
38 * @deffunc ap_fini_vhost_config(apr_pool_t *p, server_rec *main_server)
40 AP_DECLARE(void) ap_fini_vhost_config(apr_pool_t *p, server_rec *main_server);
43 * handle addresses in <VirtualHost> statement
44 * @param p The pool to allocate out of
45 * @param hostname The hostname in the VirtualHost statement
46 * @param s The list of Virtual Hosts.
48 const char *ap_parse_vhost_addrs(apr_pool_t *p, const char *hostname, server_rec *s);
50 /* handle NameVirtualHost directive */
51 const char *ap_set_name_virtual_host (cmd_parms *cmd, void *dummy,
55 * given an ip address only, give our best guess as to what vhost it is
56 * @param conn The current connection
58 AP_DECLARE(void) ap_update_vhost_given_ip(conn_rec *conn);
61 * ap_update_vhost_given_ip is never enough, and this is always called after
62 * the headers have been read. It may change r->server.
63 * @param r The current request
65 AP_DECLARE(void) ap_update_vhost_from_headers(request_rec *r);
68 * Match the host in the header with the hostname of the server for this
70 * @param r The current request
71 * @param host The hostname in the headers
72 * @param port The port from the headers
73 * @return return 1 if the host:port matches any of the aliases of r->server,
75 * @deffunc int ap_matches_request_vhost(request_rec *r, const char *host, apr_port_t port)
77 AP_DECLARE(int) ap_matches_request_vhost(request_rec *r, const char *host,
84 #endif /* !APACHE_HTTP_VHOST_H */