comm: add -Wall
[unleashed.git] / usr / src / cmd / nscd / nscd_common.h
blobf45ce07f07f36500c40b1aeb1dc857ccecf91c97
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _NSCD_COMMON_H
27 #define _NSCD_COMMON_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 #include <sys/types.h>
36 #include <synch.h>
39 * nscd internal return/error codes
41 typedef 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_DOOR_BUFFER_CHECK_FAILED,
73 NSCD_SELF_CRED_NOT_CONFIGURED,
74 NSCD_SELF_CRED_NO_FORKER,
75 NSCD_SELF_CRED_WRONG_NSCD,
76 NSCD_SELF_CRED_MAIN_IMPOSTER,
77 NSCD_SELF_CRED_FORKER_IMPOSTER,
78 NSCD_SELF_CRED_CHILD_IMPOSTER,
79 NSCD_SELF_CRED_NO_DOOR,
80 NSCD_SELF_CRED_NO_CHILD_SLOT,
81 NSCD_SELF_CRED_INVALID_SLOT_NUMBER,
82 NSCD_SELF_CRED_INVALID_SLOT_STATE,
83 NSCD_ADMIN_FAIL_TO_SET,
84 NSCD_CACHE_INVALID_CACHE_NAME,
85 NSCD_CACHE_NO_CACHE_CTX,
86 NSCD_CACHE_DISABLED,
87 NSCD_CACHE_NO_CACHE_FOUND,
88 NSCD_CACHE_AVOID_NS
90 } nscd_rc_t;
93 /* nscd data type: boolean */
94 typedef uint8_t nscd_bool_t;
95 #define nscd_true 1
96 #define nscd_false 0
98 /* common functions */
99 void _nscd_set_start_time(int reset);
100 time_t _nscd_get_start_time();
101 nscd_rc_t _nscd_init(char *cfgfile);
102 nscd_rc_t _nscd_refresh();
104 #ifdef __cplusplus
106 #endif
108 #endif /* _NSCD_COMMON_H */