1*1fcced4cSJordan Brown /*
2*1fcced4cSJordan Brown  * CDDL HEADER START
3*1fcced4cSJordan Brown  *
4*1fcced4cSJordan Brown  * The contents of this file are subject to the terms of the
5*1fcced4cSJordan Brown  * Common Development and Distribution License (the "License").
6*1fcced4cSJordan Brown  * You may not use this file except in compliance with the License.
7*1fcced4cSJordan Brown  *
8*1fcced4cSJordan Brown  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*1fcced4cSJordan Brown  * or http://www.opensolaris.org/os/licensing.
10*1fcced4cSJordan Brown  * See the License for the specific language governing permissions
11*1fcced4cSJordan Brown  * and limitations under the License.
12*1fcced4cSJordan Brown  *
13*1fcced4cSJordan Brown  * When distributing Covered Code, include this CDDL HEADER in each
14*1fcced4cSJordan Brown  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*1fcced4cSJordan Brown  * If applicable, add the following below this CDDL HEADER, with the
16*1fcced4cSJordan Brown  * fields enclosed by brackets "[]" replaced with your own identifying
17*1fcced4cSJordan Brown  * information: Portions Copyright [yyyy] [name of copyright owner]
18*1fcced4cSJordan Brown  *
19*1fcced4cSJordan Brown  * CDDL HEADER END
20*1fcced4cSJordan Brown  */
21*1fcced4cSJordan Brown 
22*1fcced4cSJordan Brown /*
23*1fcced4cSJordan Brown  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24*1fcced4cSJordan Brown  * Use is subject to license terms.
25*1fcced4cSJordan Brown  */
26*1fcced4cSJordan Brown 
27*1fcced4cSJordan Brown #ifndef _DIRECTORY_SERVER_IMPL_H
28*1fcced4cSJordan Brown #define	_DIRECTORY_SERVER_IMPL_H
29*1fcced4cSJordan Brown 
30*1fcced4cSJordan Brown /*
31*1fcced4cSJordan Brown  * Internal implementation details for the server side of directory lookup.
32*1fcced4cSJordan Brown  */
33*1fcced4cSJordan Brown 
34*1fcced4cSJordan Brown #ifdef __cplusplus
35*1fcced4cSJordan Brown extern "C" {
36*1fcced4cSJordan Brown #endif
37*1fcced4cSJordan Brown 
38*1fcced4cSJordan Brown /*
39*1fcced4cSJordan Brown  * Functions to populate Directory Attribute Value lists.
40*1fcced4cSJordan Brown  */
41*1fcced4cSJordan Brown directory_error_t str_list_dav(directory_values_rpc *lvals,
42*1fcced4cSJordan Brown     const char * const *str_list, int n);
43*1fcced4cSJordan Brown directory_error_t uint_list_dav(directory_values_rpc *lvals,
44*1fcced4cSJordan Brown     const unsigned int *uint_list, int n);
45*1fcced4cSJordan Brown directory_error_t bin_list_dav(directory_values_rpc *lvals,
46*1fcced4cSJordan Brown     const void *array, int n, size_t sz);
47*1fcced4cSJordan Brown 
48*1fcced4cSJordan Brown /*
49*1fcced4cSJordan Brown  * Split a name@domain into name, domain.  Recommend allocating the
50*1fcced4cSJordan Brown  * destination buffers the same size as the input, on the stack,
51*1fcced4cSJordan Brown  * using variable length arrays.
52*1fcced4cSJordan Brown  */
53*1fcced4cSJordan Brown void split_name(char *name, char *domain, char *id);
54*1fcced4cSJordan Brown 
55*1fcced4cSJordan Brown /*
56*1fcced4cSJordan Brown  * Insert a directory_error_t into a directory entry to be returned.
57*1fcced4cSJordan Brown  * Caller MUST NOT free the directory_error_t.
58*1fcced4cSJordan Brown  */
59*1fcced4cSJordan Brown void directory_entry_set_error(directory_entry_rpc *ent,
60*1fcced4cSJordan Brown     directory_error_t de);
61*1fcced4cSJordan Brown 
62*1fcced4cSJordan Brown /*
63*1fcced4cSJordan Brown  * This is the structure by which a provider supplies its entry points.
64*1fcced4cSJordan Brown  * The name is not currently used.
65*1fcced4cSJordan Brown  */
66*1fcced4cSJordan Brown struct directory_provider_static {
67*1fcced4cSJordan Brown 	char *name;
68*1fcced4cSJordan Brown 	directory_error_t (*get)(
69*1fcced4cSJordan Brown 	    directory_entry_rpc *ret,
70*1fcced4cSJordan Brown 	    idmap_utf8str_list *ids,
71*1fcced4cSJordan Brown 	    idmap_utf8str types,
72*1fcced4cSJordan Brown 	    idmap_utf8str_list *attrs);
73*1fcced4cSJordan Brown };
74*1fcced4cSJordan Brown 
75*1fcced4cSJordan Brown #ifdef __cplusplus
76*1fcced4cSJordan Brown }
77*1fcced4cSJordan Brown #endif
78*1fcced4cSJordan Brown 
79*1fcced4cSJordan Brown #endif /* _DIRECTORY_SERVER_IMPL_H */
80