cachemgr.h revision 5025:cc9a15b4f5ed
1321369Sdim/*
2234285Sdim * CDDL HEADER START
3353358Sdim *
4353358Sdim * The contents of this file are subject to the terms of the
5353358Sdim * Common Development and Distribution License (the "License").
6234285Sdim * You may not use this file except in compliance with the License.
7234285Sdim *
8234285Sdim * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9261991Sdim * or http://www.opensolaris.org/os/licensing.
10261991Sdim * See the License for the specific language governing permissions
11261991Sdim * and limitations under the License.
12261991Sdim *
13261991Sdim * When distributing Covered Code, include this CDDL HEADER in each
14261991Sdim * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15261991Sdim * If applicable, add the following below this CDDL HEADER, with the
16261991Sdim * fields enclosed by brackets "[]" replaced with your own identifying
17261991Sdim * information: Portions Copyright [yyyy] [name of copyright owner]
18261991Sdim *
19261991Sdim * CDDL HEADER END
20261991Sdim */
21261991Sdim/*
22261991Sdim * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23261991Sdim * Use is subject to license terms.
24261991Sdim */
25276479Sdim
26261991Sdim#ifndef	_CACHEMGR_H
27261991Sdim#define	_CACHEMGR_H
28327952Sdim
29261991Sdim#pragma ident	"%Z%%M%	%I%	%E% SMI"
30261991Sdim
31261991Sdim#ifdef __cplusplus
32261991Sdimextern "C" {
33261991Sdim#endif
34321369Sdim
35261991Sdim#include "ns_sldap.h"
36261991Sdim#include "ns_internal.h"
37261991Sdim#include "ns_cache_door.h"
38261991Sdim#include "cachemgr_door.h"
39261991Sdim
40261991Sdim#define	LOGFILE		"/var/ldap/cachemgr.log"
41261991Sdim#define	KILLCACHEMGR	"/var/lib/ldap/ldap_cachemgr -K"
42261991Sdim#define	MAXBITSIZE	30
43261991Sdim#define	MAXDEBUG	DBG_ALL
44314564Sdim#define	DEFAULTTTL	3600		/* 1 hour */
45314564Sdim
46261991Sdimtypedef	union {
47261991Sdim	ldap_data_t	data;
48261991Sdim	char		space[BUFFERSIZE];
49261991Sdim} dataunion;
50261991Sdim
51234285Sdimextern char *getcacheopt(char *s);
52234285Sdimextern void logit(char *format, ...);
53234285Sdimextern int load_admin_defaults(admin_t *ptr, int will_become_server);
54234285Sdimextern int getldap_init(void);
55234285Sdimextern void getldap_revalidate(void);
56234285Sdimextern int getldap_uidkeepalive(int keep, int interval);
57234285Sdimextern int getldap_invalidate(void);
58234285Sdimextern void getldap_lookup(LineBuf *config_info, ldap_call_t *in);
59234285Sdimextern void getldap_refresh(void);
60234285Sdimextern int cachemgr_set_dl(admin_t *ptr, int value);
61261991Sdimextern int cachemgr_set_ttl(ldap_stat_t *cache, char *name, int value);
62261991Sdimextern int get_clearance(int callnumber);
63261991Sdimextern int release_clearance(int callnumber);
64261991Sdim#ifdef SLP
65261991Sdimextern void discover();
66261991Sdim#endif /* SLP */
67261991Sdimextern void getldap_serverInfo_refresh(void);
68261991Sdimextern void getldap_getserver(LineBuf *config_info, ldap_call_t *in);
69261991Sdimextern void getldap_get_cacheData(LineBuf *config_info, ldap_call_t *in);
70261991Sdimextern int getldap_set_cacheData(ldap_call_t *in);
71261991Sdimextern void getldap_get_cacheStat(LineBuf *stat_info);
72234285Sdim#ifdef __cplusplus
73234285Sdim}
74249423Sdim#endif
75249423Sdim
76234285Sdim#endif /* _CACHEMGR_H */
77314564Sdim