xref: /illumos-gate/usr/src/cmd/nscd/nscd_admin.h (revision 2a8bcb4e)
1*cb5caa98Sdjl /*
2*cb5caa98Sdjl  * CDDL HEADER START
3*cb5caa98Sdjl  *
4*cb5caa98Sdjl  * The contents of this file are subject to the terms of the
5*cb5caa98Sdjl  * Common Development and Distribution License (the "License").
6*cb5caa98Sdjl  * You may not use this file except in compliance with the License.
7*cb5caa98Sdjl  *
8*cb5caa98Sdjl  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*cb5caa98Sdjl  * or http://www.opensolaris.org/os/licensing.
10*cb5caa98Sdjl  * See the License for the specific language governing permissions
11*cb5caa98Sdjl  * and limitations under the License.
12*cb5caa98Sdjl  *
13*cb5caa98Sdjl  * When distributing Covered Code, include this CDDL HEADER in each
14*cb5caa98Sdjl  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*cb5caa98Sdjl  * If applicable, add the following below this CDDL HEADER, with the
16*cb5caa98Sdjl  * fields enclosed by brackets "[]" replaced with your own identifying
17*cb5caa98Sdjl  * information: Portions Copyright [yyyy] [name of copyright owner]
18*cb5caa98Sdjl  *
19*cb5caa98Sdjl  * CDDL HEADER END
20*cb5caa98Sdjl  */
21*cb5caa98Sdjl /*
22*cb5caa98Sdjl  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*cb5caa98Sdjl  * Use is subject to license terms.
24*cb5caa98Sdjl  */
25*cb5caa98Sdjl 
26*cb5caa98Sdjl #ifndef _NSCD_ADMIN_H
27*cb5caa98Sdjl #define	_NSCD_ADMIN_H
28*cb5caa98Sdjl 
29*cb5caa98Sdjl #ifdef	__cplusplus
30*cb5caa98Sdjl extern "C" {
31*cb5caa98Sdjl #endif
32*cb5caa98Sdjl 
33*cb5caa98Sdjl #include "cache.h"
34*cb5caa98Sdjl #include "nscd_common.h"
35*cb5caa98Sdjl #include "nscd_config.h"
36*cb5caa98Sdjl 
37*cb5caa98Sdjl #define	NSCD_LOGFILE_LEN 128
38*cb5caa98Sdjl 
39*cb5caa98Sdjl /*
40*cb5caa98Sdjl  * structure used for door call NSCD_GETADMIN and NSCD_GETPUADMIN
41*cb5caa98Sdjl  */
42*cb5caa98Sdjl typedef struct nscd_admin {
43*cb5caa98Sdjl 	int			debug_level;
44*cb5caa98Sdjl 	char			logfile[NSCD_LOGFILE_LEN];
45*cb5caa98Sdjl 	nscd_cfg_cache_t	cache_cfg[CACHE_CTX_COUNT];
46*cb5caa98Sdjl 	nscd_cfg_stat_cache_t	cache_stats[CACHE_CTX_COUNT];
47*cb5caa98Sdjl } nscd_admin_t;
48*cb5caa98Sdjl 
49*cb5caa98Sdjl /*
50*cb5caa98Sdjl  * structure used for door call NSCD_SETADMIN and NSCD_SETPUADMIN
51*cb5caa98Sdjl  */
52*cb5caa98Sdjl typedef struct nscd_admin_mod {
53*cb5caa98Sdjl 	int			total_size;
54*cb5caa98Sdjl 	nscd_bool_t		debug_level_set;
55*cb5caa98Sdjl 	nscd_bool_t		logfile_set;
56*cb5caa98Sdjl 	uint8_t			cache_cfg_set[CACHE_CTX_COUNT];
57*cb5caa98Sdjl 	uint8_t			cache_flush_set[CACHE_CTX_COUNT];
58*cb5caa98Sdjl 	nscd_bool_t		global_cfg_set;
59*cb5caa98Sdjl 	uint8_t			cache_cfg_num;
60*cb5caa98Sdjl 	uint8_t			cache_flush_num;
61*cb5caa98Sdjl 	int			debug_level;
62*cb5caa98Sdjl 	char			logfile[NSCD_LOGFILE_LEN];
63*cb5caa98Sdjl 	nscd_cfg_cache_t	cache_cfg[CACHE_CTX_COUNT];
64*cb5caa98Sdjl } nscd_admin_mod_t;
65*cb5caa98Sdjl 
66*cb5caa98Sdjl #ifdef	__cplusplus
67*cb5caa98Sdjl }
68*cb5caa98Sdjl #endif
69*cb5caa98Sdjl 
70*cb5caa98Sdjl int _nscd_client_getadmin(char opt);
71*cb5caa98Sdjl int _nscd_client_setadmin();
72*cb5caa98Sdjl void _nscd_client_showstats();
73*cb5caa98Sdjl nscd_rc_t _nscd_server_setadmin(nscd_admin_mod_t *set);
74*cb5caa98Sdjl int _nscd_door_getadmin(void *outbuf);
75*cb5caa98Sdjl void _nscd_door_setadmin(void *buf);
76*cb5caa98Sdjl int _nscd_add_admin_mod(char *dbname, char opt,
77*cb5caa98Sdjl 		char *val, char *msg, int msglen);
78*cb5caa98Sdjl 
79*cb5caa98Sdjl #endif	/* _NSCD_ADMIN_H */
80