ap_listen.h revision 355ea18be961f4d35656d3aced89e2707fae78b7
97a9a944b5887e91042b019776c41d5dd74557aferikabele/* ====================================================================
97a9a944b5887e91042b019776c41d5dd74557aferikabele * The Apache Software License, Version 1.1
97a9a944b5887e91042b019776c41d5dd74557aferikabele *
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive * Copyright (c) 2000 The Apache Software Foundation. All rights
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive * reserved.
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * Redistribution and use in source and binary forms, with or without
5a58787efeb02a1c3f06569d019ad81fd2efa06end * modification, are permitted provided that the following conditions
5a58787efeb02a1c3f06569d019ad81fd2efa06end * are met:
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * 1. Redistributions of source code must retain the above copyright
5a58787efeb02a1c3f06569d019ad81fd2efa06end * notice, this list of conditions and the following disclaimer.
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * 2. Redistributions in binary form must reproduce the above copyright
5a58787efeb02a1c3f06569d019ad81fd2efa06end * notice, this list of conditions and the following disclaimer in
3f08db06526d6901aa08c110b5bc7dde6bc39905nd * the documentation and/or other materials provided with the
5a58787efeb02a1c3f06569d019ad81fd2efa06end * distribution.
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * 3. The end-user documentation included with the redistribution,
3f08db06526d6901aa08c110b5bc7dde6bc39905nd * if any, must include the following acknowledgment:
5a58787efeb02a1c3f06569d019ad81fd2efa06end * "This product includes software developed by the
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd * Apache Software Foundation (http://www.apache.org/)."
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * Alternately, this acknowledgment may appear in the software itself,
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * if and wherever such third-party acknowledgments normally appear.
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd *
e1e8390280254f7f0580d701e583f670643d4f3fnilgun * 4. The names "Apache" and "Apache Software Foundation" must
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung * not be used to endorse or promote products derived from this
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * software without prior written permission. For written
5a58787efeb02a1c3f06569d019ad81fd2efa06end * permission, please contact apache@apache.org.
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * 5. Products derived from this software may not be called "Apache",
5a58787efeb02a1c3f06569d019ad81fd2efa06end * nor may "Apache" appear in their name, without prior written
5a58787efeb02a1c3f06569d019ad81fd2efa06end * permission of the Apache Software Foundation.
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
06ba4a61654b3763ad65f52283832ebf058fdf1cslive * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
ced7ef1f8c0df1805da0e87dbc5a1b6282910573nd * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ced7ef1f8c0df1805da0e87dbc5a1b6282910573nd * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
b21197dc8e6b8c764fdcc24d4bae8b0eebb6bc4end * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
97a9a944b5887e91042b019776c41d5dd74557aferikabele * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
f8396ed8364b56ec8adeaa49cac35a929758a29eslive * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
ffb01336be79c64046b636e59fa8ddca8ec029edsf * SUCH DAMAGE.
f8396ed8364b56ec8adeaa49cac35a929758a29eslive * ====================================================================
f8396ed8364b56ec8adeaa49cac35a929758a29eslive *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * This software consists of voluntary contributions made by many
5a58787efeb02a1c3f06569d019ad81fd2efa06end * individuals on behalf of the Apache Software Foundation. For more
5a58787efeb02a1c3f06569d019ad81fd2efa06end * information on the Apache Software Foundation, please see
5a58787efeb02a1c3f06569d019ad81fd2efa06end * <http://www.apache.org/>.
deeee6bb6fd94c0ba5f3730b58abd9d299c89ccdnd */
4db28ee269aa06f7c6232e11cd01f58c3349af23noodl
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#ifndef AP_LISTEN_H
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#define AP_LISTEN_H
4a31db3c3a0202003c1b9f87affa7cc143e120e5sf
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#include "apr_network_io.h"
ffb01336be79c64046b636e59fa8ddca8ec029edsf#include "http_config.h"
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#include "mpm.h"
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cndtypedef struct ap_listen_rec ap_listen_rec;
2bc7f1cf720973a67f8ff7a8d523e40569ae5b6cndstruct ap_listen_rec {
117c1f888a14e73cdd821dc6c23eb0411144a41cnd ap_listen_rec *next;
117c1f888a14e73cdd821dc6c23eb0411144a41cnd ap_socket_t *sd;
117c1f888a14e73cdd821dc6c23eb0411144a41cnd int active;
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#ifdef WIN32
117c1f888a14e73cdd821dc6c23eb0411144a41cnd int count;
117c1f888a14e73cdd821dc6c23eb0411144a41cnd#endif
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick/* more stuff here, like which protocol is bound to the port */
4db28ee269aa06f7c6232e11cd01f58c3349af23noodl};
5a58787efeb02a1c3f06569d019ad81fd2efa06end
5a58787efeb02a1c3f06569d019ad81fd2efa06endextern ap_listen_rec *ap_listeners;
5a58787efeb02a1c3f06569d019ad81fd2efa06end
5a58787efeb02a1c3f06569d019ad81fd2efa06endvoid ap_listen_pre_config(void);
5a58787efeb02a1c3f06569d019ad81fd2efa06end#if !defined(WIN32) && !defined(PREFORK_MPM)
5a58787efeb02a1c3f06569d019ad81fd2efa06endint ap_setup_listeners(server_rec *s);
654d8eb036bedc99e90e11910ee02d3421417697rbowen#else
5a58787efeb02a1c3f06569d019ad81fd2efa06endint ap_listen_open(process_rec *process, unsigned port);
5a58787efeb02a1c3f06569d019ad81fd2efa06end#endif
5a58787efeb02a1c3f06569d019ad81fd2efa06endconst char *ap_set_listenbacklog(cmd_parms *cmd, void *dummy, const char *arg);
5a58787efeb02a1c3f06569d019ad81fd2efa06endconst char *ap_set_listener(cmd_parms *cmd, void *dummy, const char *ips);
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsfconst char *ap_set_send_buffer_size(cmd_parms *cmd, void *dummy,
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick const char *arg);
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick#define LISTEN_COMMANDS \
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawickAP_INIT_TAKE1("ListenBacklog", ap_set_listenbacklog, NULL, RSRC_CONF, \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "Maximum length of the queue of pending connections, as used by listen(2)"), \
654d8eb036bedc99e90e11910ee02d3421417697rbowenAP_INIT_TAKE1("Listen", ap_set_listener, NULL, RSRC_CONF, \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "A port number or a numeric IP address and a port number"), \
06ba4a61654b3763ad65f52283832ebf058fdf1csliveAP_INIT_TAKE1("SendBufferSize", ap_set_send_buffer_size, NULL, RSRC_CONF, \
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "Send buffer size in bytes"),
92510838f2eb125726e15c5eb4f7a23c7a0396e4slive
97a9a944b5887e91042b019776c41d5dd74557aferikabele#endif
654d8eb036bedc99e90e11910ee02d3421417697rbowen