Blame include/http_vhost.h

Packit 90a5c9
/* Licensed to the Apache Software Foundation (ASF) under one or more
Packit 90a5c9
 * contributor license agreements.  See the NOTICE file distributed with
Packit 90a5c9
 * this work for additional information regarding copyright ownership.
Packit 90a5c9
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 90a5c9
 * (the "License"); you may not use this file except in compliance with
Packit 90a5c9
 * the License.  You may obtain a copy of the License at
Packit 90a5c9
 *
Packit 90a5c9
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 90a5c9
 *
Packit 90a5c9
 * Unless required by applicable law or agreed to in writing, software
Packit 90a5c9
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 90a5c9
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 90a5c9
 * See the License for the specific language governing permissions and
Packit 90a5c9
 * limitations under the License.
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @file  http_vhost.h
Packit 90a5c9
 * @brief Virtual Host package
Packit 90a5c9
 *
Packit 90a5c9
 * @defgroup APACHE_CORE_VHOST Virtual Host Package
Packit 90a5c9
 * @ingroup  APACHE_CORE
Packit 90a5c9
 * @{
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
#ifndef APACHE_HTTP_VHOST_H
Packit 90a5c9
#define APACHE_HTTP_VHOST_H
Packit 90a5c9
Packit 90a5c9
#ifdef __cplusplus
Packit 90a5c9
extern "C" {
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * called before any config is read
Packit 90a5c9
 * @param p Pool to allocate out of
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_init_vhost_config(apr_pool_t *p);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * called after the config has been read to compile the tables needed to do
Packit 90a5c9
 * the run-time vhost lookups
Packit 90a5c9
 * @param p The pool to allocate out of
Packit 90a5c9
 * @param main_server The start of the virtual host list
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_fini_vhost_config(apr_pool_t *p, server_rec *main_server);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * handle addresses in "<VirtualHost>" statement
Packit 90a5c9
 * @param p The pool to allocate out of
Packit 90a5c9
 * @param hostname The hostname in the VirtualHost statement
Packit 90a5c9
 * @param s The list of Virtual Hosts.
Packit 90a5c9
 */
Packit 90a5c9
const char *ap_parse_vhost_addrs(apr_pool_t *p, const char *hostname, server_rec *s);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * handle NameVirtualHost directive
Packit 90a5c9
 * @param cmd Command Parameters structure
Packit 90a5c9
 * @param dummy NOT USED
Packit 90a5c9
 * @param arg a host of the form "<address>[:port]"
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_NONSTD(const char *)ap_set_name_virtual_host(cmd_parms *cmd,
Packit 90a5c9
                                                        void *dummy,
Packit 90a5c9
                                                        const char *arg);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Callback function for every Name Based Virtual Host.
Packit 90a5c9
 * @param baton Opaque user object
Packit 90a5c9
 * @param conn The current Connection
Packit 90a5c9
 * @param s The current Server
Packit 90a5c9
 * @see ap_vhost_iterate_given_conn
Packit 90a5c9
 * @return 0 on success, any non-zero return will stop the iteration.
Packit 90a5c9
 */
Packit 90a5c9
typedef int(*ap_vhost_iterate_conn_cb)(void* baton, conn_rec* conn, server_rec* s);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * For every virtual host on this connection, call func_cb.
Packit 90a5c9
 * @param conn The current connection
Packit 90a5c9
 * @param func_cb Function called for every Name Based Virtual Host for this
Packit 90a5c9
 *                connection.
Packit 90a5c9
 * @param baton Opaque object passed to func_cb.
Packit 90a5c9
 * @return The return value from func_cb.
Packit 90a5c9
 * @note If func_cb returns non-zero, the function will return at this point,
Packit 90a5c9
 *       and not continue iterating the virtual hosts.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_vhost_iterate_given_conn(conn_rec *conn,
Packit 90a5c9
                                            ap_vhost_iterate_conn_cb func_cb,
Packit 90a5c9
                                            void* baton);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * given an ip address only, give our best guess as to what vhost it is
Packit 90a5c9
 * @param conn The current connection
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_update_vhost_given_ip(conn_rec *conn);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * ap_update_vhost_given_ip is never enough, and this is always called after
Packit 90a5c9
 * the headers have been read.  It may change r->server.
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_update_vhost_from_headers(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Match the host in the header with the hostname of the server for this
Packit 90a5c9
 * request.
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @param host The hostname in the headers
Packit 90a5c9
 * @param port The port from the headers
Packit 90a5c9
 * @return return 1 if the host:port matches any of the aliases of r->server,
Packit 90a5c9
 * return 0 otherwise
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_matches_request_vhost(request_rec *r, const char *host,
Packit 90a5c9
    apr_port_t port);
Packit 90a5c9
Packit 90a5c9
#ifdef __cplusplus
Packit 90a5c9
}
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
#endif  /* !APACHE_HTTP_VHOST_H */
Packit 90a5c9
/** @} */