xref: /illumos-gate/usr/src/lib/krb5/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h (revision 1da57d551424de5a9d469760be7c4b4d4f10a755)
1 /*
2  * lib/kdb/kdb_ldap/ldap_misc.h
3  *
4  * Copyright (c) 2004-2005, Novell, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  *   * Redistributions of source code must retain the above copyright notice,
11  *       this list of conditions and the following disclaimer.
12  *   * Redistributions in binary form must reproduce the above copyright
13  *       notice, this list of conditions and the following disclaimer in the
14  *       documentation and/or other materials provided with the distribution.
15  *   * The copyright holder's name is not used to endorse or promote products
16  *       derived from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 /*
32  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
33  * Use is subject to license terms.
34  */
35 
36 #ifndef _HAVE_LDAP_MISC_H
37 #define _HAVE_LDAP_MISC_H 1
38 
39 #include "ldap_services.h"
40 
41 /* misc functions */
42 
43 krb5_error_code
44 updateAttribute (LDAP *, char *, char *, char  *);
45 
46 krb5_error_code
47 deleteAttribute (LDAP *, char *, char *, char *);
48 
49 krb5_error_code
50 populateServers(LDAP *, char **, char ***, char *, char **);
51 
52 krb5_error_code
53 disjoint_members(char **, char **);
54 
55 krb5_error_code
56 is_principal_in_realm(krb5_ldap_context *, krb5_const_principal);
57 
58 krb5_error_code
59 checkattributevalue(LDAP *, char *, char *, char **, int *);
60 
61 krb5_error_code
62 krb5_get_attributes_mask(krb5_context, krb5_db_entry *, unsigned int *);
63 
64 krb5_error_code
65 krb5_get_princ_type(krb5_context, krb5_db_entry *, int *);
66 
67 krb5_error_code
68 krb5_get_princ_count(krb5_context, krb5_db_entry *, int *);
69 
70 krb5_error_code
71 krb5_get_linkdn(krb5_context, krb5_db_entry *, char ***);
72 
73 krb5_error_code
74 krb5_get_userdn(krb5_context, krb5_db_entry *, char **);
75 
76 krb5_error_code
77 krb5_get_containerdn(krb5_context, krb5_db_entry *, char **);
78 
79 krb5_error_code
80 store_tl_data(krb5_tl_data *, int, void *);
81 
82 krb5_error_code
83 decode_tl_data(krb5_tl_data *, int, void **);
84 
85 krb5_error_code
86 is_principal_in_realm(krb5_ldap_context *, krb5_const_principal);
87 
88 krb5_error_code
89 krb5_get_subtree_info(krb5_ldap_context *, char ***, unsigned int *);
90 
91 krb5_error_code
92 krb5_ldap_read_server_params(krb5_context , char *, int);
93 
94 krb5_error_code
95 krb5_ldap_free_server_params(krb5_ldap_context *);
96 
97 krb5_error_code
98 copy_arrays(char **, char ***, int);
99 
100 krb5_error_code
101 krb5_ldap_list(krb5_context, char ***, char *, char *);
102 
103 krb5_error_code
104 krb5_ldap_get_value(LDAP *, LDAPMessage *, char *, int *);
105 
106 krb5_error_code
107 krb5_ldap_get_string(LDAP *, LDAPMessage *, char *, char **, krb5_boolean *);
108 
109 krb5_error_code
110 krb5_ldap_get_strings(LDAP *, LDAPMessage *, char *, char ***, krb5_boolean *);
111 
112 krb5_error_code
113 krb5_ldap_get_time(LDAP *, LDAPMessage *, char *, krb5_timestamp *, krb5_boolean *);
114 
115 krb5_error_code
116 krb5_add_member(LDAPMod ***, int *);
117 
118 krb5_error_code
119 krb5_add_str_mem_ldap_mod(LDAPMod  ***, char *, int, char **);
120 
121 krb5_error_code
122 krb5_add_ber_mem_ldap_mod(LDAPMod  ***, char *, int, struct berval **);
123 
124 krb5_error_code
125 krb5_add_int_arr_mem_ldap_mod(LDAPMod  ***, char *, int, int *);
126 
127 krb5_error_code
128 krb5_add_int_mem_ldap_mod(LDAPMod  ***, char *, int , int);
129 
130 krb5_error_code
131 krb5_ldap_free_mod_array(LDAPMod **);
132 
133 krb5_error_code
134 krb5_ldap_get_reference_count (krb5_context, char *, char *, int *, LDAP *);
135 
136 krb5_error_code
137 krb5_ldap_policydn_to_name (krb5_context, char *, char **);
138 
139 krb5_error_code
140 krb5_ldap_name_to_policydn (krb5_context, char *, char **);
141 
142 krb5_error_code
143 krb5_ldap_get_db_opt(char *, char **, char **);
144 
145 krb5_error_code
146 populate_krb5_db_entry(krb5_context context,
147     krb5_ldap_context *ldap_context,
148     LDAP *ld,
149     LDAPMessage *ent,
150     krb5_const_principal princ,
151     krb5_db_entry *entry);
152 
153 #endif
154