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