s3: Use db_ctdb_ltdb_parse in db_ctdb_ltdb_fetch
[kai/samba.git] / source3 / lib / server_prefork_util.h
1 /*
2    Unix SMB/CIFS implementation.
3    Prefork Helpers.
4
5    Copyright (C) Simo Sorce <idra@samba.org> 2011
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _SERVER_PREFORK_UTIL_H_
22 #define _SERVER_PREFORK_UTIL_H_
23
24 struct tevent_context;
25 struct messaging_context;
26
27 #define PFH_INIT        0x00
28 #define PFH_NEW_MAX     0x01
29 #define PFH_ENOSPC      0x02
30
31 struct pf_daemon_config {
32         int prefork_status;
33         int min_children;
34         int max_children;
35         int spawn_rate;
36         int max_allowed_clients;
37         int child_min_life;
38 };
39
40 void pfh_daemon_config(const char *daemon_name,
41                         struct pf_daemon_config *cfg,
42                         struct pf_daemon_config *default_cfg);
43
44 void pfh_manage_pool(struct tevent_context *ev_ctx,
45                      struct messaging_context *msg_ctx,
46                      struct pf_daemon_config *cfg,
47                      struct prefork_pool *pool);
48
49 void pfh_client_terminated(struct pf_worker_data *pf);
50 bool pfh_child_allowed_to_accept(struct pf_worker_data *pf);
51
52 #endif /* _SERVER_PREFORK_UTIL_H_ */