Apache HTTPD
ap_listen.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. 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
26#ifndef AP_LISTEN_H
27#define AP_LISTEN_H
28
29#include "apr_network_io.h"
30#include "httpd.h"
31#include "http_config.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37typedef struct ap_slave_t ap_slave_t;
39typedef apr_status_t (*accept_function)(void **csd, ap_listen_rec *lr, apr_pool_t *ptrans);
40
75
82
87
95
110 ap_listen_rec ***buckets,
111 int *num_buckets);
112
117
123
128
129/* Although these functions are exported from libmain, they are not really
130 * public functions. These functions are actually called while parsing the
131 * config file, when one of the LISTEN_COMMANDS directives is read. These
132 * should not ever be called by external modules. ALL MPMs should include
133 * LISTEN_COMMANDS in their command_rec table so that these functions are
134 * called.
135 */
136AP_DECLARE_NONSTD(const char *) ap_set_listenbacklog(cmd_parms *cmd, void *dummy, const char *arg);
137AP_DECLARE_NONSTD(const char *) ap_set_listencbratio(cmd_parms *cmd, void *dummy, const char *arg);
139 int argc, char *const argv[]);
141 const char *arg);
143 void *dummy,
144 const char *arg);
145
146#define LISTEN_COMMANDS \
147AP_INIT_TAKE1("ListenBacklog", ap_set_listenbacklog, NULL, RSRC_CONF, \
148 "Maximum length of the queue of pending connections, as used by listen(2)"), \
149AP_INIT_TAKE1("ListenCoresBucketsRatio", ap_set_listencbratio, NULL, RSRC_CONF, \
150 "Ratio between the number of CPU cores (online) and the number of listeners buckets"), \
151AP_INIT_TAKE_ARGV("Listen", ap_set_listener, NULL, RSRC_CONF, \
152 "A port number or a numeric IP address and a port number, and an optional protocol"), \
153AP_INIT_TAKE1("SendBufferSize", ap_set_send_buffer_size, NULL, RSRC_CONF, \
154 "Send buffer size in bytes"), \
155AP_INIT_TAKE1("ReceiveBufferSize", ap_set_receive_buffer_size, NULL, \
156 RSRC_CONF, "Receive buffer size in bytes")
157
158#ifdef __cplusplus
159}
160#endif
161
162#endif
#define AP_DECLARE_DATA
Definition ap_config.h:89
#define AP_DECLARE_NONSTD(type)
Definition ap_config.h:77
#define AP_DECLARE(type)
Definition ap_config.h:67
APR Network library.
void * csd
struct ap_slave_t ap_slave_t
Definition ap_listen.h:37
void ap_close_listeners(void)
Definition listen.c:763
const char * ap_set_listenbacklog(cmd_parms *cmd, void *dummy, const char *arg)
Definition listen.c:901
const char * ap_set_send_buffer_size(cmd_parms *cmd, void *dummy, const char *arg)
Definition listen.c:941
int ap_num_listen_buckets
Definition listen.c:49
const char * ap_set_listencbratio(cmd_parms *cmd, void *dummy, const char *arg)
Definition listen.c:921
const char * ap_set_listener(cmd_parms *cmd, void *dummy, int argc, char *const argv[])
Definition listen.c:847
apr_status_t(* accept_function)(void **csd, ap_listen_rec *lr, apr_pool_t *ptrans)
Definition ap_listen.h:39
int ap_close_selected_listeners(ap_slave_t *)
Definition listen.c:787
void ap_close_listeners_ex(ap_listen_rec *listeners)
Definition listen.c:778
void ap_listen_pre_config(void)
Definition listen.c:804
int ap_have_so_reuseport
Definition listen.c:56
apr_status_t ap_duplicate_listeners(apr_pool_t *p, server_rec *s, ap_listen_rec ***buckets, int *num_buckets)
Definition listen.c:669
ap_listen_rec * ap_listeners
Definition listen.c:42
int ap_setup_listeners(server_rec *s)
Definition listen.c:610
const char * ap_set_receive_buffer_size(cmd_parms *cmd, void *dummy, const char *arg)
Definition listen.c:960
void * dummy
Definition http_vhost.h:62
void const char * arg
Definition http_vhost.h:63
int apr_status_t
Definition apr_errno.h:44
apr_pool_t int argc
Definition apr_getopt.h:104
const char * s
Definition apr_strings.h:95
apr_cmdtype_e cmd
Apache Configuration.
HTTP Daemon routines.
apr_pool_t * p
Definition md_event.c:32
static unsigned long num_buckets
const char * argv[3]
Apache's listeners record.
Definition ap_listen.h:47
ap_listen_rec * next
Definition ap_listen.h:51
const char * protocol
Definition ap_listen.h:71
ap_slave_t * slave
Definition ap_listen.h:73
accept_function accept_func
Definition ap_listen.h:63
apr_sockaddr_t * bind_addr
Definition ap_listen.h:59
apr_socket_t * sd
Definition ap_listen.h:55
A structure to store information for each virtual server.
Definition httpd.h:1322