xref: /illumos-gate/usr/src/lib/libnisdb/ldap_op.h (revision 7a6d80f1660abd4755c68cbd094d4a914681d26e)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_LDAP_OP_H
28 #define	_LDAP_OP_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 #include <sys/types.h>
35 
36 /*
37  * Need _SOLARIS_SDK in order to get LDAP_CONTROL_SIMPLE_PAGE from new <ldap.h>
38  */
39 #ifndef	_SOLARIS_SDK
40 #define	_SOLARIS_SDK
41 #endif
42 
43 #include <lber.h>
44 #include <ldap.h>
45 #include <rpcsvc/nis.h>
46 
47 #include "ldap_parse.h"
48 #include "ldap_structs.h"
49 #include "ldap_ruleval.h"
50 #include "nis_parse_ldap_conf.h"
51 
52 /* Exported functions */
53 __nis_ldap_search_t	*buildLdapSearch(char *base, int scope,
54 				int numFilterComps, char **filterComp,
55 				char *filter, char **attrs, int attrsonly,
56 				int isDN);
57 void			freeLdapSearch(__nis_ldap_search_t *ls);
58 __nis_ldap_search_t	*createLdapRequest(__nis_table_mapping_t *t,
59 				__nis_rule_value_t *rv, char **dn,
60 				int fromLDAP, int *res,
61 				__nis_object_dn_t *objectDN);
62 int			ldapDestroy(void);
63 int			string2method(char *method);
64 int			ldapConnect(void);
65 __nis_rule_value_t	*ldapSearch(__nis_ldap_search_t *ls, int *numValues,
66 				__nis_rule_value_t *rvIn, int *ldapStat);
67 LDAPMod			**search2LdapMod(__nis_rule_value_t *rv, int add,
68 				int oc);
69 int			ldapModify(char *dn, __nis_rule_value_t *rv,
70 				char *objClassAttrs, int addFirst);
71 int			ldapAdd(char *dn, __nis_rule_value_t *rv,
72 				char *objClassAttrs, void *lcv);
73 int			ldapChangeDN(char *oldDn, char *dn);
74 
75 #ifdef	__cplusplus
76 }
77 #endif
78 
79 #endif	/* _LDAP_OP_H */
80