/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2012 Milan Jurik. All rights reserved.
*/
#include <stdlib.h>
#include <locale.h>
#include <string.h>
#include "cache.h"
#include "nscd_door.h"
#include "nscd_log.h"
#include "nscd_admin.h"
extern nsc_ctx_t *cache_ctx_p[];
extern char *cache_name[];
/*ARGSUSED*/
int
{
int i;
/*
* if size of buffer is not big enough, tell the caller to
* increase it to the size returned
*/
return (sizeof (admin_c));
for (i = 0; i < CACHE_CTX_COUNT; i++) {
if (cache_ctx_p[i] != NULL) {
} else {
sizeof (admin_c.cache_stats[0]));
}
}
return (0);
}
void
{
(void) printf("nscd configuration:\n\n");
}
/*ARGSUSED*/
{
int i, j;
char *dbname;
/* one setadmin at a time */
(void) mutex_lock(&mod_lock);
set->cache_cfg_num);
}
/*
* global admin stuff
*/
!= NSCD_SUCCESS) {
(me, "unable to set debug level %d\n",
set->debug_level);
goto err_exit;
}
}
goto err_exit;
}
}
/*
* For caches to be changed
*/
(me, "number of caches (%d) to change out of bound %s\n",
set->cache_cfg_num);
goto err_exit;
}
for (i = 0; i < set->cache_cfg_num; i++) {
j = set->cache_cfg_set[i];
dbname = cache_name[j];
if (cache_ctx_p[j] == NULL) {
(me, "unable to find cache context for %s\n",
dbname);
}
if (rc != NSCD_SUCCESS) {
(me, "unable to get handle for < %s : %s >\n",
goto err_exit;
}
if (rc != NSCD_SUCCESS) {
(me, "unable to set admin data for < %s : %s >\n",
goto err_exit;
}
}
/*
* For caches to be flushed
*/
(me, "number of caches (%d) to flush out of bound %s\n",
goto err_exit;
}
for (i = 0; i < set->cache_flush_num; i++) {
int j;
j = set->cache_flush_set[i];
if (cache_ctx_p[j] == NULL) {
(me, "unable to find cache context for %s\n",
dbname);
}
}
rc = NSCD_SUCCESS;
(void) mutex_unlock(&mod_lock);
return (rc);
}
/*ARGSUSED*/
void
{
if (rc != NSCD_SUCCESS) {
(me, "SETADMIN call failed\n");
} else {
}
}
/*
* for a database 'dbname', add config value 'val' of option 'opt'
* to the global admin_mod structure
*/
int
int i, j;
/* set initial admin_mod size; assume no cache config to set */
if (admin_mod.total_size == 0)
/* global admin stuff */
if (opt == 'l') {
} else {
}
return (0);
}
/* options to be processed next requires cache name */
*cp = '\0';
i = get_cache_idx(dbn);
if (i == -1) {
return (-1);
}
/* flush cache ? */
if (opt == 'i') {
return (0);
}
/* options to be processed next requires a param value */
return (-1);
}
/* try to use an existing cache_cfg in admin_mod */
for (j = 0; j < admin_mod.cache_cfg_num; j++) {
if (admin_mod.cache_cfg_set[j] == i)
break;
}
/* no existing one, set up another one */
if (j == admin_mod.cache_cfg_num) {
admin_mod.cache_cfg_set[j] = i;
}
switch (opt) {
case 'e':
/* enable cache */
else {
return (-1);
}
break;
case 'c':
/* check files */
else {
return (-1);
}
break;
case 'p':
/* positive time to live */
break;
case 'n':
/* negative time to live */
break;
case 'h':
/* keep hot count */
break;
}
return (0);
}
int
{
int callnum;
if (opt == 'G')
else
if (NSCD_STATUS_IS_NOT_OK(&phdr)) {
return (1);
}
return (0);
}
int
{
}