2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A *Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A/* LINTLIBRARY */
2N/A/* PROTOLIB1 */
2N/A
2N/A#include <stdio.h>
2N/A#include <sys/types.h>
2N/A#include <lber.h>
2N/A#include <ldap.h>
2N/A#include "ns_sldap.h"
2N/A#include "ns_internal.h"
2N/A
2N/A
2N/A/*
2N/A * Simplified LDAP Naming APIs
2N/A */
2N/Aint __ns_ldap_list(
2N/A const char *service,
2N/A const char *filter,
2N/A int (*init_filter_cb)(const ns_ldap_search_desc_t *desc,
2N/A char **realfilter, const void *userdata),
2N/A const char * const *attribute,
2N/A const ns_cred_t *cred,
2N/A const int flags,
2N/A ns_ldap_result_t ** result,
2N/A ns_ldap_error_t ** errorp,
2N/A int (*callback)(const ns_ldap_entry_t *entry, const void *userdata),
2N/A const void *userdata);
2N/A
2N/Aint __ns_ldap_list_sort(
2N/A const char *service,
2N/A const char *filter,
2N/A const char *sortattr,
2N/A int (*init_filter_cb)(const ns_ldap_search_desc_t *desc,
2N/A char **realfilter, const void *userdata),
2N/A const char * const *attribute,
2N/A const ns_cred_t *cred,
2N/A const int flags,
2N/A ns_ldap_result_t ** result,
2N/A ns_ldap_error_t ** errorp,
2N/A int (*callback)(const ns_ldap_entry_t *entry, const void *userdata),
2N/A const void *userdata);
2N/A
2N/Aint __ns_ldap_addAttr(
2N/A const char *service,
2N/A const char *dn,
2N/A const ns_ldap_attr_t * const *attr,
2N/A const ns_cred_t *cred,
2N/A const int flags,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_delAttr(
2N/A const char *service,
2N/A const char *dn,
2N/A const ns_ldap_attr_t * const *attr,
2N/A const ns_cred_t *cred,
2N/A const int flags,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_repAttr(
2N/A const char *service,
2N/A const char *dn,
2N/A const ns_ldap_attr_t * const *attr,
2N/A const ns_cred_t *cred,
2N/A const int flags,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_addEntry(
2N/A const char *service,
2N/A const char *dn,
2N/A const ns_ldap_entry_t *entry,
2N/A const ns_cred_t *cred,
2N/A const int flags,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_addTypedEntry(
2N/A const char *servicetype,
2N/A const char *basedn,
2N/A const void *data,
2N/A const int create,
2N/A const ns_cred_t *cred,
2N/A const int flags,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_delEntry(
2N/A const char *service,
2N/A const char *dn,
2N/A const ns_cred_t *cred,
2N/A const int flags,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_firstEntry(
2N/A const char *service,
2N/A const char *filter,
2N/A const char *sortattr,
2N/A int (*init_filter_cb)(const ns_ldap_search_desc_t *desc,
2N/A char **realfilter, const void *userdata),
2N/A const char * const *attribute,
2N/A const ns_cred_t *cred,
2N/A const int flags,
2N/A void **cookie,
2N/A ns_ldap_result_t ** result,
2N/A ns_ldap_error_t **errorp,
2N/A const void *userdata);
2N/A
2N/Aint __ns_ldap_nextEntry(
2N/A void *cookie,
2N/A ns_ldap_result_t ** result,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_endEntry(
2N/A void **cookie,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_freeResult(
2N/A ns_ldap_result_t **result);
2N/A
2N/Aint __ns_ldap_freeError(
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_freeCookie(
2N/A void **cookie);
2N/A
2N/Aint __ns_ldap_uid2dn(
2N/A const char *uid,
2N/A char **userDN,
2N/A const ns_cred_t *cred,
2N/A ns_ldap_error_t ** errorp);
2N/A
2N/Aint __ns_ldap_host2dn(
2N/A const char *host,
2N/A const char *domain,
2N/A char **hostDN,
2N/A const ns_cred_t *cred,
2N/A ns_ldap_error_t ** errorp);
2N/A
2N/Aint __ns_ldap_dn2domain(
2N/A const char *dn,
2N/A char **domain,
2N/A const ns_cred_t *cred,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_auth(
2N/A const ns_cred_t *cred,
2N/A const int flag,
2N/A ns_ldap_error_t **errorp,
2N/A LDAPControl **serverctrls,
2N/A LDAPControl **clientctrls);
2N/A
2N/Aint __ns_ldap_err2str(
2N/A int err,
2N/A char **strmsg);
2N/A
2N/Aint __ns_ldap_setParam(
2N/A const ParamIndexType type,
2N/A const void *data,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_getParam(
2N/A const ParamIndexType type,
2N/A void ***data,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_freeParam(
2N/A void ***data);
2N/A
2N/Achar **__ns_ldap_getAttr(
2N/A const ns_ldap_entry_t *entry,
2N/A const char *attrname);
2N/A
2N/Aint __s_api_prepend_automountmapname_to_dn(
2N/A const char *service,
2N/A char **basedn,
2N/A ns_ldap_error_t ** errorp);
2N/A
2N/Achar *__s_api_get_canonical_name(
2N/A ns_ldap_entry_t *entry,
2N/A ns_ldap_attr_t *attrptr,
2N/A int case_ignore);
2N/A
2N/Avoid __ns_ldap_setServer(
2N/A int set);
2N/A
2N/Ans_ldap_error_t *__ns_ldap_LoadConfiguration(
2N/A void);
2N/A
2N/Ans_ldap_error_t *__ns_ldap_DumpConfiguration(
2N/A char *file);
2N/A
2N/Ans_ldap_error_t *__ns_ldap_DumpLdif(
2N/A char *filename);
2N/A
2N/Ans_ldap_error_t *__ns_ldap_print_config(
2N/A int verbose);
2N/A
2N/Avoid __ns_ldap_default_config(
2N/A void);
2N/A
2N/Aint __ns_ldap_download(
2N/A const char *profile,
2N/A char *addr,
2N/A char *baseDN,
2N/A ns_ldap_error_t **errorp);
2N/A
2N/Aint __ns_ldap_check_dns_preq(
2N/A int foreground,
2N/A int mode_verbose,
2N/A int mode_quiet,
2N/A const char *fname,
2N/A ns_ldap_self_gssapi_config_t config,
2N/A ns_ldap_error_t **errpp);
2N/A
2N/Aint __ns_ldap_check_gssapi_preq(
2N/A int foreground,
2N/A int mode_verbose,
2N/A int mode_quiet,
2N/A ns_ldap_self_gssapi_config_t config,
2N/A ns_ldap_error_t **errpp);
2N/A
2N/Aint __ns_ldap_check_all_preq(
2N/A int foreground,
2N/A int mode_verbose,
2N/A int mode_quiet,
2N/A ns_ldap_self_gssapi_config_t config,
2N/A ns_ldap_error_t **errpp);