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
07925104db56e5c3eacc4865b918bd16af5cec59gww * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * This is a private header file. Applications should not directly include
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * this file.
cb5caa98562cf06753163f558cbcfe30b8f4673adjlextern "C" {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * OR'D in by server to call self for updates
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * debug levels
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Max size name we allow to be passed to avoid
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * buffer overflow problems
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * cached entry status
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#define ST_PENDING (ST_LOOKUP_PENDING | ST_UPDATE_PENDING)
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Cache eviction start and stop levels
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * other internal constants
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#define _NSC_FILE_CHECK_TIME 0 /* check always for backwards compat */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Macros used for logging purposes
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Macros used by compare routines
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * nsc_lookup action
cb5caa98562cf06753163f558cbcfe30b8f4673adjltypedef enum {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * What each entry in the nameserver cache looks like.
3ea037cc19cdc1fa08072c41271d316bfbf9c54amichen * Structure to handle waiting for pending name service requests
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Macros used by hash table
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * _NSC_HTSIZE_PRIMES are prime numbers that are used as hash table
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * sizes when hash table type is nsc_ht_prime. For hash tables of
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * type nsc_ht_power2, the size is automatically calculated.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Number of primes listed below is _NSC_HTSIZE_NUM_SLOTS + 1.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Each number (except the first) is a prime closest to a
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * power of 2 in increasing order. Ex: 509 is the closest prime to
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * 512 (2**9), 1021 is closest to 1024 (2**10), and so on.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * The first prime is chosen as 211 for historical reasons.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#define _NSC_HTSIZE_PRIMES 211, 509, 1021, 2053, 4099, 8191, \
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * cache backend param group (global)
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * cache backend param group (per database)
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * cache backend stat group (per database)
cb5caa98562cf06753163f558cbcfe30b8f4673adjl ulong_t invalidate_count; /* count for cache invalidation */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl void (*getlogstr)(char *, char *, size_t, nss_XbyY_args_t *);
c9a5bc8f8ef20fd68ff0b46331bbaf26e1415abbMilan Jurik int db_count; /* number of caches, max _NSC_MAX_DB */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* Context initialization */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* Functions used to throttle threads */
3ea037cc19cdc1fa08072c41271d316bfbf9c54amichenextern int nscd_wait(nsc_ctx_t *, nsc_db_t *, nsc_entry_t *);
3ea037cc19cdc1fa08072c41271d316bfbf9c54amichenextern int nscd_signal(nsc_ctx_t *, nsc_db_t *, nsc_entry_t *);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* Cache creation and initialization */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl int (*compar) (const void *, const void *),
cb5caa98562cf06753163f558cbcfe30b8f4673adjl void (*getlogstr)(char *, char *, size_t, nss_XbyY_args_t *),
cb5caa98562cf06753163f558cbcfe30b8f4673adjl enum hash_type, int);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* Cache backend lookup */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* Cache backend info */
cb5caa98562cf06753163f558cbcfe30b8f4673adjlextern void nsc_info(nsc_ctx_t *, char *, nscd_cfg_cache_t cfg[],
cb5caa98562cf06753163f558cbcfe30b8f4673adjlextern int nsc_dump(char *, int);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#endif /* NSCD_DEBUG */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* Cache invalidate */
cb5caa98562cf06753163f558cbcfe30b8f4673adjlextern void nsc_invalidate(nsc_ctx_t *, char *, nsc_ctx_t **);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* Keep hot functions */
cb5caa98562cf06753163f558cbcfe30b8f4673adjl/* hash related routines */
cb5caa98562cf06753163f558cbcfe30b8f4673adjlextern void leave(int n);
cb5caa98562cf06753163f558cbcfe30b8f4673adjlextern int get_cache_idx(char *);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl#endif /* _NSCD_H */