xref: /illumos-gate/usr/src/cmd/idmap/idmapd/directory_server_impl.h (revision 45ede40b2394db7967e59f19288fae9b62efd4aa)
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 /*
23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _DIRECTORY_SERVER_IMPL_H
28 #define	_DIRECTORY_SERVER_IMPL_H
29 
30 /*
31  * Internal implementation details for the server side of directory lookup.
32  */
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * Functions to populate Directory Attribute Value lists.
40  */
41 directory_error_t str_list_dav(directory_values_rpc *lvals,
42     const char * const *str_list, int n);
43 directory_error_t uint_list_dav(directory_values_rpc *lvals,
44     const unsigned int *uint_list, int n);
45 directory_error_t bin_list_dav(directory_values_rpc *lvals,
46     const void *array, int n, size_t sz);
47 
48 /*
49  * Split a name@domain into name, domain.  Recommend allocating the
50  * destination buffers the same size as the input, on the stack,
51  * using variable length arrays.
52  */
53 void split_name(char *name, char *domain, char *id);
54 
55 /*
56  * Insert a directory_error_t into a directory entry to be returned.
57  * Caller MUST NOT free the directory_error_t.
58  */
59 void directory_entry_set_error(directory_entry_rpc *ent,
60     directory_error_t de);
61 
62 /*
63  * This is the structure by which a provider supplies its entry points.
64  * The name is not currently used.
65  */
66 struct directory_provider_static {
67 	char *name;
68 	directory_error_t (*get)(
69 	    directory_entry_rpc *ret,
70 	    idmap_utf8str_list *ids,
71 	    idmap_utf8str types,
72 	    idmap_utf8str_list *attrs);
73 };
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif /* _DIRECTORY_SERVER_IMPL_H */
80