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]
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 #pragma ident "%Z%%M% %I% %E% SMI"
35 #include <nss_dbdefs.h> /* nssuint_t */
36 #include "nscd_common.h"
38 /* make a pointer 8-byte aligned, or an integer a multiple of 8 */
39 #define roundup(x) (((unsigned long)(x)+7) & ~7)
44 #define NSCD_DATA_UNKNOWN 0
45 #define NSCD_DATA_NSW_CONFIG 1
46 #define NSCD_DATA_NSW_STATE_BASE 2
47 #define NSCD_DATA_GETENT_CTX_BASE 3
48 #define NSCD_DATA_BACKEND_INFO 4
49 #define NSCD_DATA_BACKEND_INFO_DB 5
50 #define NSCD_DATA_CFG_NSW_DB_INDEX 6
51 #define NSCD_DATA_CFG_NSW_SRC_INDEX 7
52 #define NSCD_DATA_CFG_PARAM_INDEX 8
53 #define NSCD_DATA_CFG_STAT_INDEX 9
54 #define NSCD_DATA_ADDR 127
55 #define NSCD_DATA_CTX_ADDR 128
58 * database operation options
61 NSCD_GET_FIRST_DB_ENTRY
= 1,
62 NSCD_GET_NEXT_DB_ENTRY
= 2,
63 NSCD_GET_EXACT_DB_ENTRY
= 3,
64 NSCD_ADD_DB_ENTRY_FIRST
= 4,
65 NSCD_ADD_DB_ENTRY_LAST
= 5,
66 NSCD_ADD_DB_ENTRY_REPLACE
= 6,
67 NSCD_ADD_DB_ENTRY_IF_NONE
= 7,
68 NSCD_DEL_FIRST_DB_ENTRY
= 8,
69 NSCD_DEL_ALL_DB_ENTRY
= 9,
70 NSCD_DEL_EXACT_DB_ENTRY
= 10
74 * This structure defines an instance of the
75 * nscd database entry.
77 typedef struct nscd_db_entry
{
87 * sequence number attached to nscd data
89 typedef nssuint_t nscd_seq_num_t
;
90 typedef nssuint_t nscd_cookie_num_t
;
93 * The nscd_access_s datatype represents a nscd
94 * access data structure. It is an opaque structure.
97 typedef struct nscd_access_s nscd_access_t
;
98 struct nscd_acc_data_s
;
99 typedef struct nscd_acc_data_s nscd_acc_data_t
;
102 * The nscd_db_t datatype represents a nscd
103 * database. It is also an opaque structure.
106 typedef struct nscd_db_s nscd_db_t
;
109 * four sizes for a nscd database:
110 * large, medium, small, tiny
112 #define NSCD_DB_SIZE_LARGE 1
113 #define NSCD_DB_SIZE_MEDIUM 2
114 #define NSCD_DB_SIZE_SMALL 3
115 #define NSCD_DB_SIZE_TINY 4
118 * options for _nscd_alloc()
120 #define NSCD_ALLOC_MUTEX 0x0001
121 #define NSCD_ALLOC_RWLOCK 0x0002
122 #define NSCD_ALLOC_COND 0x0004
131 _nscd_get_cookie_num();
135 nscd_acc_data_t
*data
);
139 nscd_acc_data_t
*old
,
140 nscd_acc_data_t
*new);
144 nscd_acc_data_t
*data
);
148 nscd_acc_data_t
*data
);
152 nscd_acc_data_t
*data
);
156 nscd_acc_data_t
*data
);
159 _nscd_rw_unlock_no_release(
160 nscd_acc_data_t
*data
);
164 nscd_acc_data_t
*data
);
168 nscd_acc_data_t
*data
);
172 nscd_acc_data_t
*data
);
176 nscd_acc_data_t
*data
,
184 nscd_acc_data_t
*data
),
191 nscd_seq_num_t seq_num
);
196 nscd_seq_num_t seq_num
);
201 nscd_seq_num_t seq_num
);
212 _nscd_alloc_db_entry(
219 const nscd_db_entry_t
*
224 nscd_db_option_t option
,
231 nscd_db_entry_t
*entry
,
232 nscd_db_option_t option
);
235 _nscd_delete_db_entry(
239 nscd_db_option_t option
,
244 _nscd_create_int_addrDB();
247 _nscd_destroy_int_addrDB();
253 #endif /* _NSCD_DB_H */