00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00026 #ifndef AP_LISTEN_H
00027 #define AP_LISTEN_H
00028
00029 #include "apr_network_io.h"
00030 #include "httpd.h"
00031 #include "http_config.h"
00032
00033 typedef struct ap_listen_rec ap_listen_rec;
00034 typedef apr_status_t (*accept_function)(void **csd, ap_listen_rec *lr, apr_pool_t *ptrans);
00035
00042 struct ap_listen_rec {
00046 ap_listen_rec *next;
00050 apr_socket_t *sd;
00054 apr_sockaddr_t *bind_addr;
00058 accept_function accept_func;
00062 int active;
00066 const char* protocol;
00067 };
00068
00072 AP_DECLARE_DATA extern ap_listen_rec *ap_listeners;
00073
00077 AP_DECLARE(void) ap_listen_pre_config(void);
00078
00085 AP_DECLARE(int) ap_setup_listeners(server_rec *s);
00086
00090 AP_DECLARE_NONSTD(void) ap_close_listeners(void);
00091
00092
00093
00094
00095
00096
00097
00098
00099 AP_DECLARE_NONSTD(const char *) ap_set_listenbacklog(cmd_parms *cmd, void *dummy, const char *arg);
00100 AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
00101 int argc, char *const argv[]);
00102 AP_DECLARE_NONSTD(const char *) ap_set_send_buffer_size(cmd_parms *cmd, void *dummy,
00103 const char *arg);
00104 AP_DECLARE_NONSTD(const char *) ap_set_receive_buffer_size(cmd_parms *cmd,
00105 void *dummy,
00106 const char *arg);
00107
00108 #define LISTEN_COMMANDS \
00109 AP_INIT_TAKE1("ListenBacklog", ap_set_listenbacklog, NULL, RSRC_CONF, \
00110 "Maximum length of the queue of pending connections, as used by listen(2)"), \
00111 AP_INIT_TAKE_ARGV("Listen", ap_set_listener, NULL, RSRC_CONF, \
00112 "A port number or a numeric IP address and a port number, and an optional protocol"), \
00113 AP_INIT_TAKE1("SendBufferSize", ap_set_send_buffer_size, NULL, RSRC_CONF, \
00114 "Send buffer size in bytes"), \
00115 AP_INIT_TAKE1("ReceiveBufferSize", ap_set_receive_buffer_size, NULL, \
00116 RSRC_CONF, "Receive buffer size in bytes")
00117
00118 #endif
00119