xref: /freebsd/crypto/krb5/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* plugins/kdb/ldap/libkdb_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 2006 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 /* misc functions */
40 
41 krb5_boolean
42 is_principal_in_realm(krb5_ldap_context *, krb5_const_principal);
43 
44 krb5_error_code
45 checkattributevalue(LDAP *, char *, char *, char **, int *);
46 
47 krb5_error_code
48 krb5_get_attributes_mask(krb5_context, krb5_db_entry *, int *);
49 
50 krb5_error_code
51 krb5_get_princ_type(krb5_context, krb5_db_entry *, int *);
52 
53 krb5_error_code
54 krb5_get_princ_count(krb5_context, krb5_db_entry *, int *);
55 
56 krb5_error_code
57 krb5_get_linkdn(krb5_context, krb5_db_entry *, char ***);
58 
59 krb5_error_code
60 krb5_get_userdn(krb5_context, krb5_db_entry *, char **);
61 
62 krb5_error_code
63 replace_rdn(krb5_context context, const char *dn, const char *newrdn,
64             char **newdn);
65 
66 krb5_error_code
67 store_tl_data(krb5_tl_data *, int, void *);
68 
69 krb5_error_code
70 krb5_get_subtree_info(krb5_ldap_context *, char ***, unsigned int *);
71 
72 krb5_error_code
73 krb5_ldap_parse_db_params(krb5_context, char **);
74 
75 krb5_error_code
76 krb5_ldap_read_server_params(krb5_context , char *, int);
77 
78 void
79 krb5_ldap_free_server_params(krb5_ldap_context *);
80 
81 krb5_error_code
82 krb5_ldap_list(krb5_context, char ***, char *, char *);
83 
84 krb5_error_code
85 krb5_ldap_get_value(LDAP *, LDAPMessage *, char *, int *);
86 
87 krb5_error_code
88 krb5_ldap_get_string(LDAP *, LDAPMessage *, char *, char **, krb5_boolean *);
89 
90 krb5_error_code
91 krb5_add_str_mem_ldap_mod(LDAPMod  ***, char *, int, char **);
92 
93 krb5_error_code
94 krb5_add_ber_mem_ldap_mod(LDAPMod  ***, char *, int, struct berval **);
95 
96 krb5_error_code
97 krb5_add_int_mem_ldap_mod(LDAPMod  ***, char *, int , int);
98 
99 krb5_error_code
100 krb5_ldap_modify_ext(krb5_context context, LDAP *ld, const char *dn,
101                      LDAPMod **mods, int op);
102 
103 krb5_error_code
104 krb5_ldap_free_mod_array(LDAPMod **);
105 
106 krb5_error_code
107 krb5_ldap_get_reference_count (krb5_context, char *, char *, int *, LDAP *);
108 
109 krb5_error_code
110 krb5_ldap_policydn_to_name (krb5_context, const char *, char **);
111 
112 krb5_error_code
113 krb5_ldap_name_to_policydn (krb5_context, char *, char **);
114 
115 krb5_error_code
116 populate_krb5_db_entry(krb5_context context,
117                        krb5_ldap_context *ldap_context,
118                        LDAP *ld,
119                        LDAPMessage *ent,
120                        krb5_const_principal princ,
121                        krb5_db_entry *entry);
122 
123 int kldap_ensure_initialized (void);
124 
125 #endif
126