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 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 typedef struct ap_listen_rec ap_listen_rec;
00038 typedef apr_status_t (*accept_function)(void **csd, ap_listen_rec *lr, apr_pool_t *ptrans);
00039
00046 struct ap_listen_rec {
00050 ap_listen_rec *next;
00054 apr_socket_t *sd;
00058 apr_sockaddr_t *bind_addr;
00062 accept_function accept_func;
00066 int active;
00070 const char* protocol;
00071 };
00072
00076 AP_DECLARE_DATA extern ap_listen_rec *ap_listeners;
00077
00081 AP_DECLARE(void) ap_listen_pre_config(void);
00082
00089 AP_DECLARE(int) ap_setup_listeners(server_rec *s);
00090
00094 AP_DECLARE_NONSTD(void) ap_close_listeners(void);
00095
00096
00097
00098
00099
00100
00101
00102
00103 AP_DECLARE_NONSTD(const char *) ap_set_listenbacklog(cmd_parms *cmd, void *dummy, const char *arg);
00104 AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
00105 int argc, char *const argv[]);
00106 AP_DECLARE_NONSTD(const char *) ap_set_send_buffer_size(cmd_parms *cmd, void *dummy,
00107 const char *arg);
00108 AP_DECLARE_NONSTD(const char *) ap_set_receive_buffer_size(cmd_parms *cmd,
00109 void *dummy,
00110 const char *arg);
00111
00112 #define LISTEN_COMMANDS \
00113 AP_INIT_TAKE1("ListenBacklog", ap_set_listenbacklog, NULL, RSRC_CONF, \
00114 "Maximum length of the queue of pending connections, as used by listen(2)"), \
00115 AP_INIT_TAKE_ARGV("Listen", ap_set_listener, NULL, RSRC_CONF, \
00116 "A port number or a numeric IP address and a port number, and an optional protocol"), \
00117 AP_INIT_TAKE1("SendBufferSize", ap_set_send_buffer_size, NULL, RSRC_CONF, \
00118 "Send buffer size in bytes"), \
00119 AP_INIT_TAKE1("ReceiveBufferSize", ap_set_receive_buffer_size, NULL, \
00120 RSRC_CONF, "Receive buffer size in bytes")
00121
00122 #ifdef __cplusplus
00123 }
00124 #endif
00125
00126 #endif