nscd_admin.h revision 2830:5228d1267a01
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#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31#ifdef	__cplusplus
32extern "C" {
33#endif
34
35#include "cache.h"
36#include "nscd_common.h"
37#include "nscd_config.h"
38
39#define	NSCD_LOGFILE_LEN 128
40
41/*
42 * structure used for door call NSCD_GETADMIN and NSCD_GETPUADMIN
43 */
44typedef struct nscd_admin {
45	int			debug_level;
46	char			logfile[NSCD_LOGFILE_LEN];
47	nscd_cfg_cache_t	cache_cfg[CACHE_CTX_COUNT];
48	nscd_cfg_stat_cache_t	cache_stats[CACHE_CTX_COUNT];
49} nscd_admin_t;
50
51/*
52 * structure used for door call NSCD_SETADMIN and NSCD_SETPUADMIN
53 */
54typedef struct nscd_admin_mod {
55	int			total_size;
56	nscd_bool_t		debug_level_set;
57	nscd_bool_t		logfile_set;
58	uint8_t			cache_cfg_set[CACHE_CTX_COUNT];
59	uint8_t			cache_flush_set[CACHE_CTX_COUNT];
60	nscd_bool_t		global_cfg_set;
61	uint8_t			cache_cfg_num;
62	uint8_t			cache_flush_num;
63	int			debug_level;
64	char			logfile[NSCD_LOGFILE_LEN];
65	nscd_cfg_cache_t	cache_cfg[CACHE_CTX_COUNT];
66} nscd_admin_mod_t;
67
68#ifdef	__cplusplus
69}
70#endif
71
72int _nscd_client_getadmin(char opt);
73int _nscd_client_setadmin();
74void _nscd_client_showstats();
75nscd_rc_t _nscd_server_setadmin(nscd_admin_mod_t *set);
76int _nscd_door_getadmin(void *outbuf);
77void _nscd_door_setadmin(void *buf);
78int _nscd_add_admin_mod(char *dbname, char opt,
79		char *val, char *msg, int msglen);
80
81#endif	/* _NSCD_ADMIN_H */
82