cb5caa98562cf06753163f558cbcfe30b8f4673adjl * CDDL HEADER START
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * The contents of this file are subject to the terms of the
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Common Development and Distribution License (the "License").
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * You may not use this file except in compliance with the License.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * See the License for the specific language governing permissions
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * and limitations under the License.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * When distributing Covered Code, include this CDDL HEADER in each
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * If applicable, add the following below this CDDL HEADER, with the
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * fields enclosed by brackets "[]" replaced with your own identifying
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * information: Portions Copyright [yyyy] [name of copyright owner]
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * CDDL HEADER END
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Use is subject to license terms.
7d7551bcfe5ded1738ddbe3268520996a32023b4Milan Jurik * Copyright 2012 Milan Jurik. All rights reserved.
cb5caa98562cf06753163f558cbcfe30b8f4673adjlextern char *cache_name[];
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/*ARGSUSED*/
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * if size of buffer is not big enough, tell the caller to
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * increase it to the size returned
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (sizeof (admin_c));
cb5caa98562cf06753163f558cbcfe30b8f4673adjl for (i = 0; i < CACHE_CTX_COUNT; i++) {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (0);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl (void) printf("%10d server debug level\n", admin_c.debug_level);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl (void) printf("\"%s\" is server log file\n", admin_c.logfile);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl (void) nsc_info(NULL, NULL, admin_c.cache_cfg, admin_c.cache_stats);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/*ARGSUSED*/
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* one setadmin at a time */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl _nscd_logit(me, "debug_level_set = %d, debug_level = %d\n",
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * global admin stuff
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * For caches to be changed
cb5caa98562cf06753163f558cbcfe30b8f4673adjl (me, "number of caches (%d) to change out of bound %s\n",
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * For caches to be flushed
cb5caa98562cf06753163f558cbcfe30b8f4673adjl (me, "number of caches (%d) to flush out of bound %s\n",
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/*ARGSUSED*/
cb5caa98562cf06753163f558cbcfe30b8f4673adjl rc = _nscd_server_setadmin(NSCD_N2N_DOOR_DATA(nscd_admin_mod_t, buf));
7d7551bcfe5ded1738ddbe3268520996a32023b4Milan Jurik NSCD_SET_N2N_STATUS(phdr, NSS_NSCD_PRIV, 0, rc);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * for a database 'dbname', add config value 'val' of option 'opt'
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * to the global admin_mod structure
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* set initial admin_mod size; assume no cache config to set */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* global admin stuff */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (0);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* options to be processed next requires cache name */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl if (i == -1) {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (-1);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* flush cache ? */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl admin_mod.cache_flush_set[admin_mod.cache_flush_num++] = i;
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (0);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* options to be processed next requires a param value */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (-1);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* try to use an existing cache_cfg in admin_mod */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* no existing one, set up another one */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl admin_mod.total_size += sizeof (admin_mod.cache_cfg[0]);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl switch (opt) {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* enable cache */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl gettext("\"yes\" or \"no\" not specified after \"%s\""), dbn);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (-1);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* check files */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl gettext("\"yes\" or \"no\" not specified after \"%s\""), dbn);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (-1);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* positive time to live */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* negative time to live */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* keep hot count */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (0);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl (void) _nscd_doorcall_data(callnum, NULL, sizeof (admin_c),
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (1);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl return (0);