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.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#pragma ident "%Z%%M% %I% %E% SMI"
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Configuration data for the nscd switch functions.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * statistics of the nscd switch functions.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * cookie is set up by the verify function for passing to
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * the notify function
cb5caa98562cf06753163f558cbcfe30b8f4673adjltypedef struct {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl nscd_switch_cfg = calloc(NSCD_NUM_DB, sizeof (nscd_cfg_switch_t));
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* ARGSUSED */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl if (_nscd_cfg_flag_is_set(dflag, NSCD_CFG_DFLAG_INIT) ||
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * group data is received, copy in the
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * entire strcture
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * individual paramater is received: copy in the
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * parameter value except for nsw-config-string.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * cookie contains data for the switch policy config
ad0e80f7538b612141768bfda60009eb76550ee7michen rc = _nscd_create_sw_struct(nswdb->index, -1, nswdb->name,
cb5caa98562cf06753163f558cbcfe30b8f4673adjl if (_nscd_cfg_flag_is_not_set(dflag, NSCD_CFG_DFLAG_STATIC_DATA))
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* ARGSUSED */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * global config data has nothing special to verify
cb5caa98562cf06753163f558cbcfe30b8f4673adjl if (_nscd_cfg_flag_is_set(pdesc->pflag, NSCD_CFG_PFLAG_GLOBAL))
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * switch policy string is the one to parse and verify
cb5caa98562cf06753163f558cbcfe30b8f4673adjl if (_nscd_cfg_flag_is_set(dflag, NSCD_CFG_DFLAG_INIT) ||
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* get it from the group data */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* not group, and not the switch policy string, return */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* the data itself is the string */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * convert the string into struct __nsw_switchconfig_v1
cb5caa98562cf06753163f558cbcfe30b8f4673adjl gettext("switch policy string too long (\"%s : %s\" > %d)"),
cb5caa98562cf06753163f558cbcfe30b8f4673adjl switchcfg = _nsw_getoneconfig_v1(nswdb->name, buf, &err);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl gettext("syntax error: switch policy string (%s : %s) rc = %d"),
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* save the __nsw_switchconfig_v1 for the notify function */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* ARGSUSED */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl if (_nscd_cfg_flag_is_set(sdesc->sflag, NSCD_CFG_SFLAG_GLOBAL)) {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl /* indicate the statistics are static, i.e., do not free */