]> granicus.if.org Git - apache/blob - include/http_vhost.h
worker MPM/mod_status: Support per-worker tracking of pid and
[apache] / include / http_vhost.h
1 /* Copyright 1999-2005 The Apache Software Foundation or its licensors, as
2  * applicable.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef APACHE_HTTP_VHOST_H
18 #define APACHE_HTTP_VHOST_H
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /**
25  * @package Virtual Host package
26  */
27
28 /**
29  * called before any config is read
30  * @param p Pool to allocate out of
31  */
32 AP_DECLARE(void) ap_init_vhost_config(apr_pool_t *p);
33
34 /**
35  * called after the config has been read to compile the tables needed to do 
36  * the run-time vhost lookups
37  * @param p The pool to allocate out of
38  * @param main_server The start of the virtual host list
39  * @deffunc ap_fini_vhost_config(apr_pool_t *p, server_rec *main_server)
40  */
41 AP_DECLARE(void) ap_fini_vhost_config(apr_pool_t *p, server_rec *main_server);
42
43 /**
44  * handle addresses in <VirtualHost> statement
45  * @param p The pool to allocate out of
46  * @param hostname The hostname in the VirtualHost statement
47  * @param s The list of Virtual Hosts.
48  */
49 const char *ap_parse_vhost_addrs(apr_pool_t *p, const char *hostname, server_rec *s);
50
51 /* handle NameVirtualHost directive */
52 const char *ap_set_name_virtual_host (cmd_parms *cmd, void *dummy,
53                                       const char *arg);
54
55 /**
56  * given an ip address only, give our best guess as to what vhost it is 
57  * @param conn The current connection
58  */
59 AP_DECLARE(void) ap_update_vhost_given_ip(conn_rec *conn);
60
61 /**
62  * ap_update_vhost_given_ip is never enough, and this is always called after 
63  * the headers have been read.  It may change r->server.
64  * @param r The current request
65  */
66 AP_DECLARE(void) ap_update_vhost_from_headers(request_rec *r);
67
68 /**
69  * Match the host in the header with the hostname of the server for this
70  * request.
71  * @param r The current request
72  * @param host The hostname in the headers
73  * @param port The port from the headers
74  * @return return 1 if the host:port matches any of the aliases of r->server,
75  * return 0 otherwise
76  * @deffunc int ap_matches_request_vhost(request_rec *r, const char *host, apr_port_t port)
77  */
78 AP_DECLARE(int) ap_matches_request_vhost(request_rec *r, const char *host,
79     apr_port_t port);
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85 #endif  /* !APACHE_HTTP_VHOST_H */