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 2004 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 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 #include <sys/types.h> 37 38 /* 39 * Need _SOLARIS_SDK in order to get LDAP_CONTROL_SIMPLE_PAGE from new <ldap.h> 40 */ 41 #ifndef _SOLARIS_SDK 42 #define _SOLARIS_SDK 43 #endif 44 45 #include <lber.h> 46 #include <ldap.h> 47 #include <rpcsvc/nis.h> 48 49 #include "ldap_parse.h" 50 #include "ldap_structs.h" 51 #include "ldap_ruleval.h" 52 #include "nis_parse_ldap_conf.h" 53 54 /* Exported functions */ 55 __nis_ldap_search_t *buildLdapSearch(char *base, int scope, 56 int numFilterComps, char **filterComp, 57 char *filter, char **attrs, int attrsonly, 58 int isDN); 59 void freeLdapSearch(__nis_ldap_search_t *ls); 60 __nis_ldap_search_t *createLdapRequest(__nis_table_mapping_t *t, 61 __nis_rule_value_t *rv, char **dn, 62 int fromLDAP, int *res, 63 __nis_object_dn_t *objectDN); 64 LDAP *ldapInit(char *server, int port, bool_t use_ssl); 65 int ldapBind(LDAP **ld, char *who, char *cred, 66 auth_method_t method, struct timeval timeout); 67 int ldapDestroy(void); 68 int string2method(char *method); 69 int ldapConnect(void); 70 __nis_rule_value_t *ldapSearch(__nis_ldap_search_t *ls, int *numValues, 71 __nis_rule_value_t *rvIn, int *ldapStat); 72 void freeLdapMod(LDAPMod **mods); 73 LDAPMod **search2LdapMod(__nis_rule_value_t *rv, int add, 74 int oc); 75 int ldapModify(char *dn, __nis_rule_value_t *rv, 76 char *objClassAttrs, int addFirst); 77 int ldapAdd(char *dn, __nis_rule_value_t *rv, 78 char *objClassAttrs, void *lcv); 79 int ldapChangeDN(char *oldDn, char *dn); 80 81 #ifdef __cplusplus 82 } 83 #endif 84 85 #endif /* _LDAP_OP_H */ 86