ldap_common.h revision cb5caa98562cf06753163f558cbcfe30b8f4673a
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LDAP_COMMON_H
#define _LDAP_COMMON_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <ctype.h>
#include <nss_dbdefs.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <lber.h>
#include <ldap.h>
#include <pwd.h>
#include "ns_sldap.h"
#define _ALIASES "aliases"
#define _AUTOMOUNT "automount"
#define _AUTHATTR "auth_attr"
#define _AUUSER "audit_user"
#define _BOOTPARAMS "bootparams"
#define _DEFAULT "default"
#define _ETHERS "ethers"
#define _EXECATTR "exec_attr"
#define _GROUP "group"
#define _PROJECT "project"
#define _HOSTS "hosts"
#define _HOSTS6 "hosts"
#define _NETGROUP "netgroup"
#define _NETMASKS "netmasks"
#define _NETWORKS "networks"
#define _PASSWD "passwd"
#define _PRINTERS "printers"
#define _PROFATTR "prof_attr"
#define _PROTOCOLS "protocols"
#define _PUBLICKEY "publickey"
#define _RPC "rpc"
#define _SERVICES "services"
#define _SHADOW "shadow"
#define _USERATTR "user_attr"
#define _TNRHDB "tnrhdb"
#define _TNRHTP "tnrhtp"
#define DOTTEDSUBDOMAIN(string) \
#define SEARCHFILTERLEN 256
#define _NO_VALUE ""
/* Use '>=' to ensure there is at least one byte left for '\0' */ \
goto label; \
} \
/* Adjust pointer and available buffer length */ \
/*
* Superset the nss_backend_t abstract data type. This ADT has
* been extended to include ldap associated data structures.
*/
typedef struct ldap_backend *ldap_backend_ptr;
typedef enum {
NSS_LDAP_DB_NONE = 0,
struct ldap_backend {
char *tablename;
void *enumcookie;
char *filter;
int setcalled;
const char **attrs;
void *netgroup_cookie;
void *services_cookie;
char *toglue;
char *buffer;
int buflen;
};
char *searchfilter, char *domain,
int (*init_filter_cb)(
const ns_ldap_search_desc_t *desc,
char **realfilter, const void *userdata),
const void *userdata);
char *searchfilter, char *domain,
int (*init_filter_cb)(
const ns_ldap_search_desc_t *desc,
char **realfilter, const void *userdata),
const void *userdata);
extern const char *_strip_quotes(char *ipaddress);
extern char *_get_domain_name(char *cdn);
char **realfilter, const void *userdata);
int filter_name_size);
extern void _nss_services_cookie_free(void **cookieP);
#ifdef DEBUG
#endif /* DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* _LDAP_COMMON_H */