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