xref: /titanic_54/usr/src/cmd/nscd/nscd_common.h (revision cb5caa98562cf06753163f558cbcfe30b8f4673a)
1*cb5caa98Sdjl /*
2*cb5caa98Sdjl  * CDDL HEADER START
3*cb5caa98Sdjl  *
4*cb5caa98Sdjl  * The contents of this file are subject to the terms of the
5*cb5caa98Sdjl  * Common Development and Distribution License (the "License").
6*cb5caa98Sdjl  * You may not use this file except in compliance with the License.
7*cb5caa98Sdjl  *
8*cb5caa98Sdjl  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*cb5caa98Sdjl  * or http://www.opensolaris.org/os/licensing.
10*cb5caa98Sdjl  * See the License for the specific language governing permissions
11*cb5caa98Sdjl  * and limitations under the License.
12*cb5caa98Sdjl  *
13*cb5caa98Sdjl  * When distributing Covered Code, include this CDDL HEADER in each
14*cb5caa98Sdjl  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*cb5caa98Sdjl  * If applicable, add the following below this CDDL HEADER, with the
16*cb5caa98Sdjl  * fields enclosed by brackets "[]" replaced with your own identifying
17*cb5caa98Sdjl  * information: Portions Copyright [yyyy] [name of copyright owner]
18*cb5caa98Sdjl  *
19*cb5caa98Sdjl  * CDDL HEADER END
20*cb5caa98Sdjl  */
21*cb5caa98Sdjl /*
22*cb5caa98Sdjl  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*cb5caa98Sdjl  * Use is subject to license terms.
24*cb5caa98Sdjl  */
25*cb5caa98Sdjl 
26*cb5caa98Sdjl #ifndef	_NSCD_COMMON_H
27*cb5caa98Sdjl #define	_NSCD_COMMON_H
28*cb5caa98Sdjl 
29*cb5caa98Sdjl #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*cb5caa98Sdjl 
31*cb5caa98Sdjl #ifdef	__cplusplus
32*cb5caa98Sdjl extern "C" {
33*cb5caa98Sdjl #endif
34*cb5caa98Sdjl 
35*cb5caa98Sdjl #include <sys/types.h>
36*cb5caa98Sdjl #include <synch.h>
37*cb5caa98Sdjl 
38*cb5caa98Sdjl /*
39*cb5caa98Sdjl  * nscd internal return/error codes
40*cb5caa98Sdjl  */
41*cb5caa98Sdjl typedef enum {
42*cb5caa98Sdjl 	NSCD_SUCCESS			= 0,
43*cb5caa98Sdjl 	NSCD_INITIALIZATION_FAILED,
44*cb5caa98Sdjl 	NSCD_CTX_NOT_FOUND,
45*cb5caa98Sdjl 	NSCD_DB_ENTRY_FOUND,
46*cb5caa98Sdjl 	NSCD_DB_ENTRY_NOT_FOUND,
47*cb5caa98Sdjl 	NSCD_INVALID_ARGUMENT,
48*cb5caa98Sdjl 	NSCD_NO_MEMORY,
49*cb5caa98Sdjl 	NSCD_THREAD_CREATE_ERROR,
50*cb5caa98Sdjl 	NSCD_SMF_ERROR,
51*cb5caa98Sdjl 	NSCD_CFG_UNSUPPORTED_SWITCH_DB,
52*cb5caa98Sdjl 	NSCD_CFG_UNSUPPORTED_SWITCH_SRC,
53*cb5caa98Sdjl 	NSCD_CFG_DLOPEN_ERROR,
54*cb5caa98Sdjl 	NSCD_CFG_DLSYM_ERROR,
55*cb5caa98Sdjl 	NSCD_CFG_SET_PARAM_FAILED,
56*cb5caa98Sdjl 	NSCD_CFG_PARAM_DESC_ERROR,
57*cb5caa98Sdjl 	NSCD_CFG_STAT_DESC_ERROR,
58*cb5caa98Sdjl 	NSCD_CFG_INVALID_HANDLE,
59*cb5caa98Sdjl 	NSCD_CFG_PARSE_ERROR,
60*cb5caa98Sdjl 	NSCD_CFG_FILE_OPEN_ERROR,
61*cb5caa98Sdjl 	NSCD_CFG_FILE_ACCESS_ERROR,
62*cb5caa98Sdjl 	NSCD_CFG_SYNTAX_ERROR,
63*cb5caa98Sdjl 	NSCD_CFG_PRELIM_CHECK_FAILED,
64*cb5caa98Sdjl 	NSCD_CFG_DATA_CONVERSION_FAILED,
65*cb5caa98Sdjl 	NSCD_CFG_WRITE_ERROR,
66*cb5caa98Sdjl 	NSCD_CFG_READ_ONLY,
67*cb5caa98Sdjl 	NSCD_CFG_CHANGE_NOT_ALLOWED,
68*cb5caa98Sdjl 	NSCD_CREATE_NSW_STATE_FAILED,
69*cb5caa98Sdjl 	NSCD_CREATE_GETENT_CTX_FAILED,
70*cb5caa98Sdjl 	NSCD_NSS_BACKEND_NOT_FOUND,
71*cb5caa98Sdjl 	NSCD_DOOR_UCRED_ERROR,
72*cb5caa98Sdjl 	NSCD_SELF_CRED_NOT_CONFIGURED,
73*cb5caa98Sdjl 	NSCD_SELF_CRED_NO_FORKER,
74*cb5caa98Sdjl 	NSCD_SELF_CRED_WRONG_NSCD,
75*cb5caa98Sdjl 	NSCD_SELF_CRED_MAIN_IMPOSTER,
76*cb5caa98Sdjl 	NSCD_SELF_CRED_FORKER_IMPOSTER,
77*cb5caa98Sdjl 	NSCD_SELF_CRED_CHILD_IMPOSTER,
78*cb5caa98Sdjl 	NSCD_SELF_CRED_NO_DOOR,
79*cb5caa98Sdjl 	NSCD_SELF_CRED_NO_CHILD_SLOT,
80*cb5caa98Sdjl 	NSCD_SELF_CRED_INVALID_SLOT_NUMBER,
81*cb5caa98Sdjl 	NSCD_SELF_CRED_INVALID_SLOT_STATE,
82*cb5caa98Sdjl 	NSCD_ADMIN_FAIL_TO_SET,
83*cb5caa98Sdjl 	NSCD_CACHE_INVALID_CACHE_NAME,
84*cb5caa98Sdjl 	NSCD_CACHE_NO_CACHE_CTX,
85*cb5caa98Sdjl 	NSCD_CACHE_DISABLED,
86*cb5caa98Sdjl 	NSCD_CACHE_NO_CACHE_FOUND,
87*cb5caa98Sdjl 	NSCD_CACHE_AVOID_NS
88*cb5caa98Sdjl 
89*cb5caa98Sdjl } nscd_rc_t;
90*cb5caa98Sdjl 
91*cb5caa98Sdjl 
92*cb5caa98Sdjl /* nscd data type: boolean */
93*cb5caa98Sdjl typedef	uint8_t		nscd_bool_t;
94*cb5caa98Sdjl #define	nscd_true	1
95*cb5caa98Sdjl #define	nscd_false	0
96*cb5caa98Sdjl 
97*cb5caa98Sdjl /* common functions */
98*cb5caa98Sdjl nscd_rc_t _nscd_init(char *cfgfile);
99*cb5caa98Sdjl nscd_rc_t _nscd_refresh();
100*cb5caa98Sdjl 
101*cb5caa98Sdjl #ifdef	__cplusplus
102*cb5caa98Sdjl }
103*cb5caa98Sdjl #endif
104*cb5caa98Sdjl 
105*cb5caa98Sdjl #endif	/* _NSCD_COMMON_H */
106