summaryrefslogtreecommitdiff
path: root/usr/src/lib/libldap4/include
diff options
context:
space:
mode:
authorMilan Jurik <milan.jurik@xylab.cz>2012-05-19 19:59:14 -0700
committerMilan Jurik <milan.jurik@xylab.cz>2012-05-19 19:59:14 -0700
commitd387ac4c164917d885cd84bd1b62647d989033ac (patch)
tree3c8503aa5915728ea1f848bfaaecb91ab62a4d91 /usr/src/lib/libldap4/include
parentad2de4358b2074634b0f2355c34b0986da0e95f9 (diff)
downloadillumos-joyent-d387ac4c164917d885cd84bd1b62647d989033ac.tar.gz
2705 EOF libldap.so.4
Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Albert Lee <trisk@nexenta.com> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/lib/libldap4/include')
-rw-r--r--usr/src/lib/libldap4/include/avl.h65
-rw-r--r--usr/src/lib/libldap4/include/cdefs.h129
-rw-r--r--usr/src/lib/libldap4/include/ch_malloc.h12
-rw-r--r--usr/src/lib/libldap4/include/charray.h23
-rw-r--r--usr/src/lib/libldap4/include/client_door.h15
-rw-r--r--usr/src/lib/libldap4/include/entry.h271
-rw-r--r--usr/src/lib/libldap4/include/fe.h420
-rw-r--r--usr/src/lib/libldap4/include/hsearch.h53
-rw-r--r--usr/src/lib/libldap4/include/lber.h240
-rw-r--r--usr/src/lib/libldap4/include/ldap-int.h343
-rw-r--r--usr/src/lib/libldap4/include/ldap-private.h360
-rw-r--r--usr/src/lib/libldap4/include/ldap.h1375
-rw-r--r--usr/src/lib/libldap4/include/ldapconfig.h279
-rw-r--r--usr/src/lib/libldap4/include/ldif.h65
-rw-r--r--usr/src/lib/libldap4/include/log.h65
-rw-r--r--usr/src/lib/libldap4/include/lthread.h187
-rw-r--r--usr/src/lib/libldap4/include/portable.h224
-rw-r--r--usr/src/lib/libldap4/include/regex.h52
-rw-r--r--usr/src/lib/libldap4/include/sec.h25
-rw-r--r--usr/src/lib/libldap4/include/ssl.h41
-rw-r--r--usr/src/lib/libldap4/include/sysexits-compat.h111
-rw-r--r--usr/src/lib/libldap4/include/thq.h75
22 files changed, 0 insertions, 4430 deletions
diff --git a/usr/src/lib/libldap4/include/avl.h b/usr/src/lib/libldap4/include/avl.h
deleted file mode 100644
index b7487c5d61..0000000000
--- a/usr/src/lib/libldap4/include/avl.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/* avl.h - avl tree definitions */
-/*
- * Copyright (c) 1993 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
-
-#ifndef _AVL
-#define _AVL
-
-/*
- * this structure represents a generic avl tree node.
- */
-
-typedef struct avlnode {
- caddr_t avl_data;
- char avl_bf;
- struct avlnode *avl_left;
- struct avlnode *avl_right;
-} Avlnode;
-
-#define NULLAVL ((Avlnode *) NULL)
-
-/* balance factor values */
-#define LH -1
-#define EH 0
-#define RH 1
-
-/* avl routines */
-#define avl_getone(x) (x == 0 ? 0 : (x)->avl_data)
-#define avl_onenode(x) (x == 0 || ((x)->avl_left == 0 && (x)->avl_right == 0))
-extern int avl_insert();
-extern caddr_t avl_delete();
-extern caddr_t avl_find();
-extern caddr_t avl_getfirst();
-extern caddr_t avl_getnext();
-extern int avl_dup_error();
-extern int avl_apply();
-
-/* apply traversal types */
-#define AVL_PREORDER 1
-#define AVL_INORDER 2
-#define AVL_POSTORDER 3
-/* what apply returns if it ran out of nodes */
-#define AVL_NOMORE -6
-
-typedef int (*IFP)();
-
-#endif /* _AVL */
diff --git a/usr/src/lib/libldap4/include/cdefs.h b/usr/src/lib/libldap4/include/cdefs.h
deleted file mode 100644
index 34b6b955d8..0000000000
--- a/usr/src/lib/libldap4/include/cdefs.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Berkeley Software Design, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)cdefs.h 8.7 (Berkeley) 1/21/94
- */
-
-#ifndef _CDEFS_H_
-#define _CDEFS_H_
-
-#if defined(__cplusplus)
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __BEGIN_DECLS
-#define __END_DECLS
-#endif
-
-/*
- * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
- * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
- * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
- * in between its arguments. __CONCAT can also concatenate double-quoted
- * strings produced by the __STRING macro, but this only works with ANSI C.
- */
-#if defined(__STDC__) || defined(__cplusplus)
-#define __P(protos) protos /* full-blown ANSI C */
-#define __CONCAT(x,y) x ## y
-#define __STRING(x) #x
-
-#define __const const /* define reserved names to standard */
-#define __signed signed
-#define __volatile volatile
-#if defined(__cplusplus)
-#define __inline inline /* convert to C++ keyword */
-#else
-#ifndef __GNUC__
-#define __inline /* delete GCC keyword */
-#endif /* !__GNUC__ */
-#endif /* !__cplusplus */
-
-#else /* !(__STDC__ || __cplusplus) */
-#define __P(protos) () /* traditional C preprocessor */
-#define __CONCAT(x,y) x/**/y
-#define __STRING(x) "x"
-
-#ifndef __GNUC__
-#define __const /* delete pseudo-ANSI C keywords */
-#define __inline
-#define __signed
-#define __volatile
-/*
- * In non-ANSI C environments, new programs will want ANSI-only C keywords
- * deleted from the program and old programs will want them left alone.
- * When using a compiler other than gcc, programs using the ANSI C keywords
- * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
- * When using "gcc -traditional", we assume that this is the intent; if
- * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
- */
-#ifndef NO_ANSI_KEYWORDS
-#define const /* delete ANSI C keywords */
-#define inline
-#define signed
-#define volatile
-#endif
-#endif /* !__GNUC__ */
-#endif /* !(__STDC__ || __cplusplus) */
-
-/*
- * GCC1 and some versions of GCC2 declare dead (non-returning) and
- * pure (no side effects) functions using "volatile" and "const";
- * unfortunately, these then cause warnings under "-ansi -pedantic".
- * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of
- * these work for GNU C++ (modulo a slight glitch in the C++ grammar
- * in the distribution version of 2.5.5).
- */
-#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5
-#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-#define __dead __volatile
-#define __pure __const
-#endif
-#endif
-
-/* Delete pseudo-keywords wherever they are not available or needed. */
-#ifndef __dead
-#define __dead
-#define __pure
-#endif
-
-#endif /* !_CDEFS_H_ */
diff --git a/usr/src/lib/libldap4/include/ch_malloc.h b/usr/src/lib/libldap4/include/ch_malloc.h
deleted file mode 100644
index 3f955511b5..0000000000
--- a/usr/src/lib/libldap4/include/ch_malloc.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-char * ch_malloc( unsigned long size );
-char * ch_realloc( char *block, unsigned long size );
-char * ch_calloc( unsigned long nelem, unsigned long size );
-char * ch_strdup( char *s1 );
-void ch_free(void *ptr);
diff --git a/usr/src/lib/libldap4/include/charray.h b/usr/src/lib/libldap4/include/charray.h
deleted file mode 100644
index 4ec4088719..0000000000
--- a/usr/src/lib/libldap4/include/charray.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-extern void charray_add(char ***a, char *s);
-extern void charray_add_uniq(char ***a, char *s);
-extern void charray_add_case_uniq(char ***a, char *s);
-extern void charray_merge(char ***a, char **s);
-extern void charray_free( char **array );
-extern int charray_inlist( char **a, char *s);
-extern char ** charray_dup( char **a );
-extern int charray_count( char **a);
-extern char ** str2charray( char *str, char *brkstr );
-extern char ** str2charray2( char *str, char *brkstr, int *NbItems );
-extern char * ch_strdup( char *s1 );
-extern void charray_sort(char **a, int (*comp_func)(const char *, const char *));
-extern int charray_pos(char **a, char *s);
-
-
-
diff --git a/usr/src/lib/libldap4/include/client_door.h b/usr/src/lib/libldap4/include/client_door.h
deleted file mode 100644
index e1ac925fa1..0000000000
--- a/usr/src/lib/libldap4/include/client_door.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- *
- * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-extern int connect_dsserv(int pid, int cid, void ** scid,
- struct in_addr * addr);
-extern int disconnect_dsserv(int pid, int cid, void * scid, int reas);
-extern int operation_buf_dsserv(int pid, int cid, void * scid,
- char * buf,int bufsize, char **rbuf, int * rsize);
-extern int operation_fd_dsserv(int pid, int cid, void * scid, int fd);
diff --git a/usr/src/lib/libldap4/include/entry.h b/usr/src/lib/libldap4/include/entry.h
deleted file mode 100644
index 81320b9bd1..0000000000
--- a/usr/src/lib/libldap4/include/entry.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- *
- * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/*
- * structs for storing and updating entries
- */
-
-#if !defined(_ENTRY_H_) && !defined(_PROTO_SLAP)
-#define _ENTRY_H_
-
-#ifndef _SLDAPD_H_
-
-/*
- * represents an attribute (type + values + syntax + oid)
- */
-typedef struct attr {
- char *a_type;
- struct berval **a_vals;
- int a_syntax;
- struct attr *a_next;
-} Attribute;
-
-/*
- * the attr_syntax() routine returns one of these values
- * telling what kind of syntax an attribute supports.
- *
- * NOTE: The syntax may not be available in libentry unless you have
- * read the slapd.conf config file.
- */
-#define SYNTAX_CIS 0x01 /* case insensitive string */
-#define SYNTAX_CES 0x02 /* case sensitive string */
-#define SYNTAX_BIN 0x04 /* binary data */
-#define SYNTAX_TEL 0x08 /* telephone number string */
-#define SYNTAX_DN 0x10 /* dn string */
-#define SYNTAX_LONG 0x20 /* integer */
-#define SYNTAX_ULONG 0x40 /* integer */
-#define SYNTAX_CRYPT 0x80 /* crypted password */
-#define SYNTAX_UTCTIME 0x0100 /* Utctime string YYMMDDhhmm[ss]Z */
-#define SYNTAX_GENTIME 0x0200 /* gentime string YYYYMMDDhhmm[ss]Z */
-
-/* These next two are used by libentry. They are overloaded into a_syntax
- * because there's no extra room and we didn't want to enlarge the structure
- * because of the performance hit.
- */
-#define ATTRIBUTE_FOUND 0x1000 /* Set if attribute was found */
-#define ATTRIBUTE_ADD 0x2000 /* Set if values are to be added instead of replaced */
-
-#define DEFAULT_SYNTAX SYNTAX_CIS
-
-typedef struct asyntaxinfo {
- char **asi_names;
- char *asi_oid;
- int asi_options;
-#define ATTR_OPT_SINGLE 0x01 /* Single Valued attr */
-#define ATTR_OPT_OPERATIONAL 0x02 /* Operational attr */
-#define ATTR_OPT_NAMING 0x10 /* Naming Attribute */
- char *asi_default_oc;
- int asi_maxlen;
- int asi_syntax;
-} AttrSyntaxInfo;
-
-/*
- * the id used in the indexes to refer to an entry
- */
-typedef unsigned int ID;
-#define NOID ((unsigned int)-1)
-
-/*
- * represents an entry in core
- */
-typedef struct entry {
- char *e_dn; /* DN of this entry */
- Attribute *e_attrs; /* list of attributes + values */
-
- ID e_id; /* not used in libentry */
- char e_state; /* only ENTRY_FOUND is used below */
-#define ENTRY_STATE_DELETED 0x01 /* value not used in libentry */
-#define ENTRY_STATE_CREATING 0x02 /* value not used in libentry */
- int e_refcnt; /* # threads ref'ing this entry */
- pthread_mutex_t e_mutex; /* to lock for add/modify */
- struct entry *e_lrunext;
- struct entry *e_lruprev; /* not used in libentry, (could be added) */
-} Entry;
-
-/* This next #define is used by libentry. It is overloaded into e_state.
- * It is used to mark entries as found/not found so that they can be deleted
- * if they are not found (for example on a remote replica).
- */
-#define ENTRY_FOUND 0x80
-
-#endif _SLDAPD_H_
-
-/* entry.c */
-
-/* output_ldif takes a modlist structure and prints out ldif. Since there are 3 ways
- * you can use a modlist structure, you need to tell this routine what you're doing.
- * The three choices are:
- * LDAP_MODIFY_ENTRY
- * LDAP_ADD_ENTRY
- * LDAP_DELETE_ENTRY
- * ldif suitable for feeding to ldapmodify will be produced.
- */
-
-/* op arg to output_ldif() */
-#define LDAP_MODIFY_ENTRY 1
-#define LDAP_ADD_ENTRY 2
-#define LDAP_DELETE_ENTRY 3
-
-void output_ldif(char *dn, int op, LDAPMod **modlist, FILE *out);
-
-/* Checks that base exist. If not, create it.
- * ld - ldap context, you must supply it because it's used in ldap_search
- * out - file to output ldif to. If supplied, ldif will be printed here,
- * if not supplied, ldap_mod will be called for you (using ld).
- *
- * returns number of entries created if all is ok, -1 if an error occured.
- *
- * mutex locks: if you are outputting to out from other threads, you need
- * to lock output_mutex. output_ldif locks this mutex before outputting.
- */
-
-int make_base(LDAP *ld, FILE *out, char *base);
-
-/* Add an entry to ldap. You supply an Entry struct. Will either add entry
- * to ldap or output ldif to an open file (stdout for example).
- *
- * ld - ldap context. Must be valid if you want entry_add to add entries to ldap
- * for you.
- * out - open file where to send ldif output. One of ld or out should be valid.
- * new_entry is an Entry which you want added to ldap
- *
- * returns number of entries created or -1 if an error occured in ldap_add()
- */
-
-int entry_add(LDAP *ld, FILE *out, Entry *new_entry);
-
-/* Compares two entries and issue changes to make old look like new.
- *
- * ld - ldap context. Must be valid if you want entry_update to add entries to ldap
- * for you.
- * out - open file where to send ldif output. One of ld or out should be valid.
- * new_entry is an Entry which you want old_entry to look like
- *
- * returns number of entries modified or -1 if an error occured in ldap_modify()
- */
-
-int entry_update(LDAP *ld, FILE *out, Entry *old_entry, Entry *new_entry);
-
-/* Deletes an entry.
- * ld - ldap context. Must be valid if you want delete_entry to call ldap
- * for you.
- * out - open file where to send ldif output. One of ld or out should be valid.
- * ldap_entry is an Entry which you want to delete
- *
- * returns number of entries deleted or -1 if an error occured in ldap_modify()
- * usually one, but for future it might delete more than one.
- */
-
-int entry_delete(LDAP *ld, FILE *out, Entry *ldap_entry);
-
-/* attr.c */
-void attr_free( Attribute *a );
-int attr_merge_fast(
- Entry *e,
- char *type,
- struct berval **vals,
- int nvals,
- int naddvals,
- int *maxvals,
- Attribute ***a
-);
-int attr_merge(
- Entry *e,
- char *type,
- struct berval **vals
-);
-
-Attribute *attr_find(
- Attribute *a,
- char *type,
- int ignoreOpt
-);
-int attr_delete(
- Attribute **attrs,
- char *type
-);
-int attr_syntax( char *type );
-int attr_syntax_by_oid( char *oid );
-void attr_syntax_config(
- char *fname,
- int lineno,
- int argc,
- char **argv
-);
-char * attr_normalize( char *s );
-char * alias_normalize( char *s );
-int type_compare(char * t1, char *t2);
-int type_list_compare(
- char **a,
- char *s
-);
-
-int attr_cmp(Attribute *attr1, Attribute *attr2);
-char * get_type_from_list(char **a, char *s);
-int attr_single_valued_check(char *type, struct berval **vals);
-AttrSyntaxInfo *get_attrSyntaxInfo(char *type);
-char * attr_syntax2oid(int aSyntax);
-
-/* value.c */
-int value_add_fast(
- struct berval ***vals,
- struct berval **addvals,
- int nvals,
- int naddvals,
- int *maxvals
-);
-int value_delete(
- struct berval ***vals,
- struct berval *v,
- int syntax,
- int normalize
-);
-int value_add_one(
- struct berval ***vals,
- struct berval *v,
- int syntax,
- int normalize
-);
-time_t utc2seconds(char * utctime);
-int value_add(
- struct berval ***vals,
- struct berval **addvals
-);
-void value_normalize(
- char *s,
- int syntax
-);
-int value_cmp(
- struct berval *v1,
- struct berval *v2,
- int syntax,
- int normalize /* 1 => arg 1; 2 => arg 2; 3 => both */
-);
-int value_ncmp(
- struct berval *v1,
- struct berval *v2,
- int syntax,
- int len,
- int normalize
-);
-int value_find(
- struct berval **vals,
- struct berval *v,
- int syntax,
- int normalize
-);
-int value_cnt(struct berval **vals);
-
-/* dn.c */
-char *dn_normalize( char *dn );
-char *dn_normalize_case( char *dn );
-int dn_issuffix(char *dn, char *suffix);
-char *dn_upcase( char *dn );
-
-#endif _ENTRY_H_
diff --git a/usr/src/lib/libldap4/include/fe.h b/usr/src/lib/libldap4/include/fe.h
deleted file mode 100644
index 1842a77352..0000000000
--- a/usr/src/lib/libldap4/include/fe.h
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- *
- * Copyright 1999 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifndef _FE_H
-#define _FE_H
-
-/*
- * Get context const . Used to retreive info in context : fe_get_ctx
- * Return values depend on requested info :
- */
-#define CTX_FENAME 1 /* To get the Front End name */
- /* return value is (char *) */
-#define CTX_NBTABLE 2 /* To get the number of sub-section */
- /* return value is (int *) */
-#define CTX_TABLENAME 3 /* To get name(s) of sub section */
- /* return value is (char **) */
-#define CTX_TABLEPTR 4 /* To get the ptr to a sub section definition */
- /* return value is (FE_Table *) */
- /* !! This is not a copy */
-#define CTX_CUSTOMS 5 /* get customs attributes */
- /* third parameter is the variable name (char *) */
-
-/*
- * Get Tables const
- */
-#define TABLE_NAME 1 /* table or subsection name, return value is (char *) */
- /* third parms is null */
-#define TABLE_OBJ_LST 2 /* object class list, return value is (char **) */
- /* third parms is null */
-#define TABLE_COM_HLD 3 /* stored ldap, connection return value is (LDAP *) */
-#define TABLE_CUSTOMS 4 /* get customs attributes */
- /* third parameter is the variable name (char *) */
- /* return value is an array of string (char **) */
-#define TABLE_FEATTR 5 /* to get the attribute definition. If no attribute name */
- /* is provided to get the list of attributes */
- /* third parms is the attribute name */
- /* return a FE_Attr * if attribute name provided */
- /* return a char ** (null term) if no attribute name provided */
-
-#define TABLE_SUNDSATTR 6 /* idem TABLE_FEATTR but for SunDS definition */
-
-/*
- * Tokens/Attributes
- */
-#define FETABLE 0
-#define SUNDSTABLE 1
-#define SUNDSATTRLIST 2
-#define SUNDSTOKENLIST 3
-#define FEATTRLIST 4
-#define FETOKENLIST 5
-#define FEBUILDLIST 6
-#define SUNDSBUILDLIST 7
-
-/*
- * Errors consts
- */
-#define NOERROR 0
-#define INVALID_PARMS 1
-#define VALUE_NOT_FOUND 2
-#define CREATE_FAILED 3
-#define SYNTAX_ERROR 4
-
-/*
- * SPLIT way
- */
-#define LEFT2RIGHT 0
-#define RIGHT2LEFT 1
-/*
- * Data structures
- */
-
-/*
- * This struct is used to run regex with "reg_expression"
- * and assigned values (braelist) with "token" links
- * Functional schema :
- * step(input,reg_expression)
- * => token[0] = braslist[0]..braelist[0]
- * => token[1] = braslist[1]..braelist[1]
- * => ...
- * => token[i] = braslist[i]..braelist[i]
- */
-typedef struct _reg_mapp {
- char *reg_expression; /* Compiled regular expression */
- int Nbra; /* nbra result */
- int NbToken_Defined; /* Nb tokens defined in reg_expression */
- int *Token_ID; /* Tokens place (index) in input value */
-} Reg_Map;
-
-/*
- * Tokens definition, including input attribute and number of expressions
- * and link to each rule.
- */
-typedef struct _tokens_def {
- int attr_ID; /* Attributes ID (in SD or FE Table) */
- /* Used as input in regular expression */
- int NbRules; /* Number of expressions seperated by | */
- Reg_Map **TokenRules; /* Array of tokens rules */
-} Token_Def;
-
-/*
- * Attribute mapping definition. SD attributes are composed of FE attributes and
- * SD tokens.
- */
-typedef struct _attr_mapping {
- char *AttrName; /* Attribute Name */
- char *Expr; /* Value expression */
- int AttrStatus; /* Store several attr's info such as */
- /* Key || Exist || Frozen */
- /* Key is used to generate wizard filter */
- /* Exist is used to generate wizard filter */
- /* Frozen is used control access on attribute */
- int NbItem; /* Nb Attributes & Tokens need to build val */
- int *AttrID; /* Set of attributes including tokens */
-} Attr_Mapping;
-
-/*
- * Builder_map : defined builder expression
- */
-typedef struct _builder_map {
- char *build_exp; /* the sentence to build */
- int NbInput;
- int *Input_ID; /* List of attr ID to used as input in semtence */
-}Builder_map;
-
-/*
- * Data used for split/string2instances/instances2string/exclude functions
- */
-typedef struct _builder_fct {
- int Input_ID;
- char *value; /* input data */
- char *prefix; /* string2instances and reverse : prefix */
- /* exclude : val 2 exclude */
- int Parm_ID; /* only for exclude funct : ID of val 2 exclude */
- char *suffix;
- char *separator;
- int readIndicator;
-} Builder_fct;
-
-/*
- * Builder tokens : used to build special value (named builder token) from other tokens
- * or input value. They look like ouput attributes, but they allow to apply rules, if
- * input value does exist. They also permit to split input sentence into attribute instances
- */
-typedef struct _builder {
- char *builder_name;
- int builder_ID;
- int NbRules;
- int BuilderType;
- Builder_map *Mapp;
- Builder_fct *Fct;
-} Build_def;
-
-
-/*
- * Full definition of table mapping.
- */
-typedef struct _table_mapping {
- int NbTokens; /* Nb extract tokens defined */
- int NbAttributes; /* Nb attributes in the entry */
- int NbBuilder; /* Nb builder tokens defined */
- Token_Def **Tokens_list; /* Array of tokens needed for translation */
- Build_def *Build_list; /* Array of builder tokens */
- Attr_Mapping **Attr_list; /* Array of Attributes defined in an entry */
-} Table_Mapping;
-
-typedef struct _custo_info {
- char *InfoName;
- int NbValues;
- char **Values; /* Null terminated array of instance */
-} Cust_Info;
-
-typedef struct _sds_com {
- LDAP *lhd; /* LDAP communication handle */
- char **fe_object_list; /* Array of ObjectClasses (null term list) */
-} SDS_Com;
-
-typedef struct _dynrule {
- char *ResName; /* Result (or Rule) name */
- int opType; /* Extrac, Cond, split, str2ins, ins2str, */
- /* getrdn, exclude */
- int NbExpr; /* Nb rules found use only in extract & cond */
- int *NbItems; /* Nb variable in expression, usefull for */
- /* extract and cond. IT's a null terminated */
- /* array which contains the Number of var in */
- char **Expression; /* The sentence (make sense only in cond) */
- char **ConstVal; /* use when funct parm are const not used for */
- /* extract and cond cases */
- char **VarName; /* Var can be 1)DynRule 2)InputData 3)Common */
-} DynRule;
-
-typedef struct _fe_table {
- char *fe_section; /* Section table name */
- int nb_fe_attr; /* Nb FE attributes defined */
- int nb_sds_attr; /* Nb SDS attributes defined */
- int nb_fe_tokens; /* Nb tokens defined in FE section */
- int nb_sds_tokens; /* Nb tokens defined in SunDS section */
- int nb_cust; /* Nb custom attributes in common section */
- int nb_fe_build; /* Nb tokens build in FE section */
- int nb_sds_build; /* Nb tokens build in SUNDS section */
- int nb_dyn_rules; /* Nb dynamic rules in Dynamic section */
- char **fe_token_list; /* Array of FE token */
- char **sds_token_list; /* List of SunDS token */
- char **fe_attr_list; /* Array of attributes (null term list) */
- char **sds_attr_list; /* Array of attributes (null term list) */
- char **fe_build_list; /* Array of FE build */
- char **sds_build_list; /* List of SunDS build */
- Table_Mapping *sds_schema; /* SDS attributes definition */
- Table_Mapping *fe_schema; /* FE attributes definition */
- SDS_Com *comm_items; /* Communication attributes */
- Cust_Info **custo_info; /* Customs info */
- DynRule *dyn_rules; /* Ordered dynamic rules */
-} FE_Table;
-
-typedef struct _fe_context {
- char *fe_name; /* Is it really usefull ?? */
- int NbSection; /* Nb section */
- int NbGlobals; /* Nb global customs info */
- Cust_Info **globals; /* Customs info */
- FE_Table **fe_section_list; /* All sub-section in mapping file */
-} FE_Context;
-
-/* Entries values definition */
-/* Instance values definition */
-typedef struct _fe_values {
- int Length;
- void *Val;
-} FE_Values;
-
-/* Attribute value definition */
-typedef struct _fe_attr {
- char *AttrType;
- int NbInstance;
- FE_Values **ValInstances;
-} FE_Attr;
-
-/* Full entry definition */
-typedef struct _fe_entry {
- char *DN;
- int Nb_items;
- FE_Attr **AttributesArray;
-} FE_Entry;
-
-typedef struct _fe_couple {
- char *Value2Subst;
- char *SubstValue;
-} FE_Couple;
-
-/*
- * libfe.a exported functions
- */
-
-/*
- * Read config file and create "fe_name" context
- * NB : This init read all tables mapping
- * libldap context use : before all action
- */
-extern FE_Context *fe_ctx_init(char *config_path, char *fe_name);
-
-/*
- * Free All fe context all tables ...
- * libldap context usage : ldap_close
- */
-extern int fe_ctx_free(FE_Context **Ctx);
-
-/*
- * Return the pointer to requested item in context
- * libldap context usage : before all action
- */
-extern void *fe_ctx_get(FE_Context *Ctx, int FieldID, void *Value);
-
-/*
- * Search for information from Subsection/Table ?
- * You can check also Get/Table/Paragraph
- * libldap context usage : ldap_*
- */
-extern void *fe_table_get(FE_Table *MapTable, int FieldID, void *Void);
-
-/*
- * Set tables item is mainly used for communication items. other information
- * sets will be forbid
- * libldap context usage : after ldap_open or ldap_bind
- */
-/*
-extern int fe_table_set(FE_Table *MapTable, int FieldID, void *Void);
-*/
-/*
- * You have the attribute name ?! fe_ent_get_attr returns pointer to the requested
- * attributes with instances, status... from a specific entry
- * libldap context usage : after ldap_search
- */
-extern FE_Attr *fe_ent_get_attr(FE_Table *MapTable, FE_Entry *fe_item, char *AttrName);
-
-/*
- * Create the entry according to the "schema" defined in mapping file for a specific table
- * libladp context usage : before ldap_add
- */
-extern FE_Entry *fe_ent_create(FE_Table *MapTable, int TableType);
-
-/*
- * Add new attributes in a new entry
- * libladp context usage : before ldap_add
- */
-extern FE_Attr *fe_ent_get_attr(FE_Table *MapTable,FE_Entry *Entry, char *AttrName);
-
-/*
- * Add new instance value
- * libladp context usage : before ldap_add
- */
-extern int fe_ent_add_val(FE_Table *MapTable, FE_Attr *attr, int ValLength, void *Val);
-extern FE_Attr *fe_ent_add_attr_val(FE_Table *MapTable, FE_Entry *Entry, char *AttrName, int ValLength, void *Val);
-
-/*
- * explode DN into an attributes array
- * libladp context usage : after ldap_search
- */
-extern FE_Attr **fe_ent_show_dn(FE_Table *MapTable, FE_Entry *Entry);
-
-/*
- * free entry (including attributes)
- */
-extern void fe_ent_free(FE_Entry **Entry);
-
-/*
- * Substitute all vars defined in inputString (with syntax ${varName}) by values found in
- * fe_couple array. For errors returned check the errors consts upper
- */
-extern int fe_subst(char *inputString, char **outputString, FE_Couple **fe_couple);
-
-/*
- * Split a sentence, add prefix (for each token) and suffix (exept for the last)
- */
-extern char *fe_split(char *inputData, char *Separator, char *Prefix, char *Suffix, int way );
-
-/*
- * Dynamic translation, use only definition in dynamic section
- */
-extern char **fe_dynamic(FE_Table *MapTable, char *Var2stop, char **DynVal);
-
-/*
- * Return the translated attribute. TableType is the original table of AttrName.
- * if translation rules is one to one translation, the function return a copy of translated
- * attribute name.
- * else the function return a copy of the rules
- */
-extern char **fe_trans_attrName(FE_Table *MapTable, char *AttrName, int TableType);
-extern int *fe_trans_attrID(FE_Table *MapTable, char *AttrName, int TableType);
-
-/*
- * Return the translated SD entry
- * libladp context usage : after ldap_search
- */
-extern FE_Entry *fe_trans_all_sds2fe(FE_Table *MapTable, LDAP *ld, LDAPMessage *sd_entry);
-
-/*
- * Return the translated FE entry
- * libladp context usage : after ldap_search
- */
-extern LDAPMod **fe_trans_all_fe2sds(FE_Table *MapTable, LDAP *ld, FE_Entry *fe_entry);
-
-/*
- * Close to "fe_trans_all_sds2fe" but output is Entry pointer as defined in SunDS server
- */
-extern FE_Entry *fe_trans_all_sunds2fe(FE_Table *MapTable, Entry *sd_entry);
-extern Entry *fe_trans_all_fe2sunds(FE_Table *MapTable, FE_Entry *fe_entry);
-
-/* An example an example ....
- * Translation from fe to sunds
- *
- * FE_Context *MyContext = NULL;
- * FE_Table *HostTable = NULL;
- * FE_Entry *fe_entry = NULL;
- * FE_Attr *fe_attr = NULL;
- * Entry *lentry = NULL;
- *
- * if((MyContext = fe_ctx_init("..../sunds_map.conf","NIS")) == NULL){
- * ldaplog(LDAP_DEBUG_CONFIG,"Can't load mapping file\n", 0, 0, 0);
- * exit(1);
- * }
- * if((HostTable = fe_ctx_get(MyContext,CTX_TABLEPTR,"dummy")) == NULL)
- * {
- * ldaplog(LDAP_DEBUG_CONFIG,"Can't retreive HOSTS table\n", 0, 0, 0);
- * exit(1);
- * }
- * if((fe_entry = fe_ent_create(HostTable, FETABLE))==NULL)
- * {
- * ldaplog(LDAP_DEBUG_CONFIG,"Can't create entry\n", 0, 0, 0);
- * exit(1);
- * }
- * if ((fe_attr = fe_ent_add_attr_val(HostTable, fe_entry, "niskey", 16, "109.107.179.131")) == NULL)
- * {
- * ldaplog(LDAP_DEBUG_CONFIG,"Can't add attr=%s, val=%s\n", "niskey", "109.107.179.131", 0);
- * exit(1);
- * }
- * if((fe_attr = fe_ent_add_attr_val(HostTable,
- * fe_entry,
- * "NISVALUE",
- * strlen("olivaw OLIVAW oLiVaW # regis Host") +1,
- * "olivaw OLIVAW oLiVaW # regis Host")) == NULL)
- * {
- * ldaplog(...);
- * exit(1);
- * }
- * if((lentry = fe_trans_all_fe2sunds(HostTable, fe_entry)) ==NULL)
- * {
- * ldaplog(LDAP_DEBUG_CONFIG,".... \n", 0);
- * }
- *
- */
-
-#endif /* _FE_H */
-
-
-
-
diff --git a/usr/src/lib/libldap4/include/hsearch.h b/usr/src/lib/libldap4/include/hsearch.h
deleted file mode 100644
index 32721aedca..0000000000
--- a/usr/src/lib/libldap4/include/hsearch.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <sys/types.h>
-
-#ident "@(#)hsearch.h 1.3 07/23/97 SMI"
-typedef struct { /* Hash table entry */
- char * key;
- char * data;
- int dsize;
- int modified;
- time_t timestamp;
-} HASH_ENTRY;
-
-typedef struct node { /* Part of the linked list of entries */
- HASH_ENTRY item;
- struct node *next;
-} NODE;
-
-typedef enum {
- FIND, /* Find, if present */
- ENTER, /* Find; enter if not present */
- REPLACE, /* replace */
- DELETE, /* delete */
-} ACTION;
-
-/* define everything that a hash table needs to drag around */
-typedef struct hash_table {
- NODE **table; /* The address of the hash table */
- unsigned int length; /* Size of the hash table */
- unsigned int m; /* Log base 2 of length */
- unsigned int count; /* nb entries in the hash table */
- mutex_t table_lock; /* currently not used */
- int alloc_data; /* true if data is allocated and copied in the hast table */
- int clean; /* to force cleanup of the hash table */
- int size; /* Max size of the hast table, defaulted 5000 */
-} HASH_TABLE;
-
-void hdestroy_s(HASH_TABLE **hash_table);
-HASH_ENTRY *hsearch_s(HASH_TABLE *hash_table, HASH_ENTRY item, ACTION action);
-HASH_ENTRY *hlist_s(HASH_TABLE *hash_table, int * i, NODE ** a);
-HASH_TABLE *hcreate_s(size_t size, int alloc_data);
-
-/* convenience functions for adding and find things */
-int hadd_s(HASH_TABLE **hash_table, char *key, void *data, int size);
-int hreplace_s(HASH_TABLE **hash_table, char *key, void *data, int size);
-char *hfind_s(HASH_TABLE *hash_table, char *key);
-int hdelete_s( HASH_TABLE *hash_table, char * key);
diff --git a/usr/src/lib/libldap4/include/lber.h b/usr/src/lib/libldap4/include/lber.h
deleted file mode 100644
index 094c04ab8b..0000000000
--- a/usr/src/lib/libldap4/include/lber.h
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * Copyright (c) 1990 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
-#ifndef _LBER_H
-#define _LBER_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(NEEDPROTOS) && defined(__STDC__)
-#define NEEDPROTOS 1
-#endif
-
-/* BER classes and mask */
-#define LBER_CLASS_UNIVERSAL 0x00
-#define LBER_CLASS_APPLICATION 0x40
-#define LBER_CLASS_CONTEXT 0x80
-#define LBER_CLASS_PRIVATE 0xc0
-#define LBER_CLASS_MASK 0xc0
-
-/* BER encoding type and mask */
-#define LBER_PRIMITIVE 0x00
-#define LBER_CONSTRUCTED 0x20
-#define LBER_ENCODING_MASK 0x20
-
-#define LBER_BIG_TAG_MASK 0x1f
-#define LBER_MORE_TAG_MASK 0x80
-
-/*
- * Note that LBER_ERROR and LBER_DEFAULT are values that can never appear
- * as valid BER tags, and so it is safe to use them to report errors. In
- * fact, any tag for which the following is true is invalid:
- * (( tag & 0x00000080 ) != 0 ) && (( tag & 0xFFFFFF00 ) != 0 )
- */
-#define LBER_ERROR 0xffffffff
-#define LBER_DEFAULT 0xffffffff
-
-/* general BER types we know about */
-#define LBER_BOOLEAN 0x01
-#define LBER_INTEGER 0x02
-#define LBER_BITSTRING 0x03
-#define LBER_OCTETSTRING 0x04
-#define LBER_NULL 0x05
-#define LBER_ENUMERATED 0x0a
-#define LBER_SEQUENCE 0x30 /* constructed */
-#define LBER_SET 0x31 /* constructed */
-
-#define OLD_LBER_SEQUENCE 0x10 /* w/o constructed bit - broken */
-#define OLD_LBER_SET 0x11 /* w/o constructed bit - broken */
-
-#ifdef NEEDPROTOS
-typedef int (*BERTranslateProc)(char **bufp, unsigned int *buflenp,
- int free_input);
-#else /* NEEDPROTOS */
-typedef int (*BERTranslateProc)();
-#endif /* NEEDPROTOS */
-
-typedef struct berelement BerElement; /* Opaque BerElement structure */
-#define NULLBER ((BerElement *) 0)
-
-#ifdef LDAP_SSL
-#include <security/ssl.h>
-#endif /* LDAP_SSL */
-
-/*
- * Structure Sockbuf which used to be defined in this header file, is
- * removed since the c-api draft does not define the structure and it
- * is only used internal to the library
- */
-
-typedef struct seqorset {
- BerElement *sos_ber;
- unsigned int sos_clen;
- unsigned int sos_tag;
- char *sos_first;
- char *sos_ptr;
- struct seqorset *sos_next;
-} Seqorset;
-#define NULLSEQORSET ((Seqorset *) 0)
-
-typedef unsigned int ber_len_t; /* for BER len */
-typedef unsigned int ber_tag_t; /* for BER tags */
-typedef int ber_int_t; /* for BER ints, enums, and Booleans */
-typedef unsigned int ber_uint_t; /* unsigned equivalent of ber_int_t */
-typedef int ber_slen_t; /* signed equivalent of ber_len_t */
-
-/* structure for returning a sequence of octet strings + length */
-typedef struct berval {
- ber_len_t bv_len;
- char *bv_val;
-} BerValue;
-
-#ifndef NEEDPROTOS
-extern BerElement *ber_alloc();
-extern BerElement *der_alloc();
-extern BerElement *ber_alloc_t();
-extern BerElement *ber_dup();
-extern BerElement *ber_init();
-extern int lber_debug;
-extern void ber_bvfree();
-extern void ber_bvecfree();
-extern struct berval *ber_bvdup();
-extern void ber_dump();
-extern void ber_sos_dump();
-extern void lber_bprint();
-extern void ber_reset();
-extern void ber_zero_init();
-#else /* NEEDPROTOS */
-
-/*
- * in bprint.c:
- */
-void lber_bprint(char *data, int len);
-
-/*
- * in decode.c:
- */
-ber_tag_t ber_get_tag(BerElement *ber);
-ber_tag_t ber_skip_tag(BerElement *ber, ber_len_t *len);
-ber_tag_t ber_peek_tag(BerElement *ber, ber_len_t *len);
-unsigned int ber_get_int(BerElement *ber, int *num);
-unsigned int ber_get_stringb(BerElement *ber, char *buf,
- ber_len_t *len);
-unsigned int ber_get_stringa(BerElement *ber, char **buf);
-unsigned int ber_get_stringal(BerElement *ber, struct berval **bv);
-unsigned int ber_get_bitstringa(BerElement *ber, char **buf,
- ber_len_t *len);
-unsigned int ber_get_null(BerElement *ber);
-unsigned int ber_get_boolean(BerElement *ber, int *boolval);
-ber_tag_t ber_first_element(BerElement *ber, ber_len_t *len,
- char **last);
-ber_tag_t ber_next_element(BerElement *ber, ber_len_t *len,
- char *last);
-#if defined(MACOS) || defined(BC31) || defined(_WIN32) || defined(__sun)
-ber_tag_t ber_scanf(BerElement *ber, char *fmt, ...);
-#else
-ber_tag_t ber_scanf();
-#endif
-void ber_bvfree(struct berval *bv);
-void ber_bvecfree(struct berval **bv);
-struct berval *ber_bvdup(struct berval *bv);
-#ifdef STR_TRANSLATION
-void ber_set_string_translators(BerElement *ber,
- BERTranslateProc encode_proc, BERTranslateProc decode_proc);
-#endif /* STR_TRANSLATION */
-int ber_flatten(BerElement *ber, struct berval **bvPtr);
-
-/*
- * in encode.c
- */
-int ber_put_enum(BerElement *ber, int num, ber_tag_t tag);
-int ber_put_int(BerElement *ber, int num, ber_tag_t tag);
-int ber_put_ostring(BerElement *ber, char *str, ber_len_t len, ber_tag_t tag);
-int ber_put_string(BerElement *ber, char *str, ber_tag_t tag);
-int ber_put_bitstring(BerElement *ber, char *str,
- unsigned int bitlen, ber_tag_t tag);
-int ber_put_null(BerElement *ber, ber_tag_t tag);
-int ber_put_boolean(BerElement *ber, int boolval, ber_tag_t tag);
-int ber_start_seq(BerElement *ber, ber_tag_t tag);
-int ber_start_set(BerElement *ber, ber_tag_t tag);
-int ber_put_seq(BerElement *ber);
-int ber_put_set(BerElement *ber);
-#if defined(MACOS) || defined(BC31) || defined(_WIN32) || defined(__sun)
-int ber_printf(BerElement *ber, char *fmt, ...);
-#else
-int ber_printf();
-#endif
-
-/*
- * in io.c:
- *
- * ber_flush() and ber_get_next() functions are obsolete and removed
- * from this library/header file
- */
-int ber_read(BerElement *ber, char *buf, ber_len_t len);
-int ber_write(BerElement *ber, char *buf, ber_len_t len, int nosos);
-void ber_free(BerElement *ber, int freebuf);
-BerElement *ber_alloc(void);
-BerElement *der_alloc(void);
-BerElement *ber_alloc_t(int options);
-BerElement *ber_dup(BerElement *ber);
-BerElement *ber_init(struct berval *bv);
-void ber_dump(BerElement *ber, int inout);
-void ber_sos_dump(Seqorset *sos);
-void ber_zero_init(BerElement *ber, int options);
-void ber_reset(BerElement *ber, int was_writing);
-
-#ifdef NEEDGETOPT
-/*
- * in getopt.c
- */
-int getopt(int nargc, char **nargv, char *ostr);
-#endif /* NEEDGETOPT */
-#endif /* NEEDPROTOS */
-
-#define LBER_HTONL(l) htonl(l)
-#define LBER_NTOHL(l) ntohl(l)
-
-/*
- * SAFEMEMCPY is an overlap-safe copy from s to d of n bytes
- */
-#ifdef sunos4
-#define SAFEMEMCPY(d, s, n) bcopy(s, d, n)
-#else /* sunos4 */
-#define SAFEMEMCPY(d, s, n) memmove(d, s, n)
-#endif /* sunos4 */
-
-#ifdef SUN
-
-/* I18N support */
-#include <locale.h>
-#include <nl_types.h>
-
-extern nl_catd slapdcat; /* for I18N support */
-extern void i18n_catopen(char *);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _LBER_H */
diff --git a/usr/src/lib/libldap4/include/ldap-int.h b/usr/src/lib/libldap4/include/ldap-int.h
deleted file mode 100644
index 12454463cb..0000000000
--- a/usr/src/lib/libldap4/include/ldap-int.h
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Copyright 1995-2002 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/*
- * Copyright (c) 1995 Regents of the University of Michigan.
- * All rights reserved.
- *
- * ldap-int.h - defines & prototypes internal to the LDAP library
- */
-
-#include <stdlib.h> /* rri */
-#include <pthread.h> /* rri */
-#include <netinet/in.h>
-
-#define LDAP_URL_PREFIX "ldap://"
-#define LDAP_URL_PREFIX_LEN 7
-#define LDAP_URL_URLCOLON "URL:"
-#define LDAP_URL_URLCOLON_LEN 4
-
-#ifdef LDAP_REFERRALS
-#define LDAP_REF_STR "Referral:\n"
-#define LDAP_REF_STR_LEN 10
-#define LDAP_LDAP_REF_STR LDAP_URL_PREFIX
-#define LDAP_LDAP_REF_STR_LEN LDAP_URL_PREFIX_LEN
-#ifdef LDAP_DNS
-#define LDAP_DX_REF_STR "dx://"
-#define LDAP_DX_REF_STR_LEN 5
-#endif /* LDAP_DNS */
-#endif /* LDAP_REFERRALS */
-
-
-/*
- * in cache.c
- */
-#ifdef NEEDPROTOS
-void add_request_to_cache( LDAP *ld, unsigned int msgtype,
- BerElement *request );
-void add_result_to_cache( LDAP *ld, LDAPMessage *result );
-int check_cache( LDAP *ld, unsigned int msgtype, BerElement *request );
-#else /* NEEDPROTOS */
-void add_request_to_cache();
-void add_result_to_cache();
-int check_cache();
-#endif /* NEEDPROTOS */
-
-
-#ifdef KERBEROS
-/*
- * in kerberos.c
- */
-#ifdef NEEDPROTOS
-char *get_kerberosv4_credentials( LDAP *ld, char *who, char *service,
- int *len );
-#else /* NEEDPROTOS */
-char *get_kerberosv4_credentials();
-#endif /* NEEDPROTOS */
-
-#endif /* KERBEROS */
-
-/*
- * in notif.c
- */
-int ldap_insert_notif(LDAP *ld, LDAPMessage *notif);
-int ldap_add_notif(LDAP *ld, LDAPMessage *notif);
-
-
-/*
- * in open.c
- */
-int ldap_thr_index(); /* rri */
-#ifdef NEEDPROTOS
-int open_default_ldap_connection(LDAP *ld);
-int open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport,
- char **krbinstancep, int async );
-#else /* NEEDPROTOS */
-int open_default_ldap_connection();
-int open_ldap_connection();
-#endif /* NEEDPROTOS */
-
-/*
- * in options.c
- */
-
-int ldap_get_option (LDAP *ld, int option, void *outvalue);
-
-/*
- * in os-ip.c
- */
-void close_ldap_connection( Sockbuf *sb ); /* rri */
-#ifdef NEEDPROTOS
-int connect_to_host(Sockbuf *sb, char *host, in_addr_t address, int port,
- int async, int bindTimeout);
-void close_connection( Sockbuf *sb );
-#else /* NEEDPROTOS */
-int connect_to_host();
-void close_connection();
-#endif /* NEEDPROTOS */
-
-#ifdef KERBEROS
-#ifdef NEEDPROTOS
-char *host_connected_to( Sockbuf *sb );
-#else /* NEEDPROTOS */
-char *host_connected_to();
-#endif /* NEEDPROTOS */
-#endif /* KERBEROS */
-
-#ifdef LDAP_REFERRALS
-#ifdef NEEDPROTOS
-int do_ldap_select( LDAP *ld, struct timeval *timeout );
-void *new_select_info( void );
-void free_select_info( void *sip );
-void mark_select_write( LDAP *ld, Sockbuf *sb );
-void mark_select_read( LDAP *ld, Sockbuf *sb );
-void mark_select_clear( LDAP *ld, Sockbuf *sb );
-long is_read_ready( LDAP *ld, Sockbuf *sb );
-long is_write_ready( LDAP *ld, Sockbuf *sb );
-#else /* NEEDPROTOS */
-int do_ldap_select();
-void *new_select_info();
-void free_select_info();
-void mark_select_write();
-void mark_select_read();
-void mark_select_clear();
-long is_read_ready();
-long is_write_ready();
-#endif /* NEEDPROTOS */
-#endif /* LDAP_REFERRALS */
-
-/*
- * in regex.c (rri)
- */
-int re_exec( char *lp );
-
-/*
- * in request.c
- */
-#ifdef NEEDPROTOS
-int send_initial_request( LDAP *ld, unsigned int msgtype,
- char *dn, BerElement *ber );
-BerElement *alloc_ber_with_options( LDAP *ld );
-void set_ber_options( LDAP *ld, BerElement *ber );
-#else /* NEEDPROTOS */
-int send_initial_request();
-BerElement *alloc_ber_with_options();
-void set_ber_options();
-#endif /* NEEDPROTOS */
-
-#if defined( LDAP_REFERRALS ) || defined( LDAP_DNS )
-#ifdef NEEDPROTOS
-int send_server_request( LDAP *ld, BerElement *ber, int msgid,
- LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc,
- int bind );
-LDAPConn *new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb,
- int connect, int bind );
-LDAPRequest *find_request_by_msgid( LDAP *ld, int msgid );
-void free_request( LDAP *ld, LDAPRequest *lr );
-void free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind );
-void dump_connection( LDAP *ld, LDAPConn *lconns, int all );
-void dump_requests_and_responses( LDAP *ld );
-#else /* NEEDPROTOS */
-int send_server_request();
-LDAPConn *new_connection();
-LDAPRequest *find_request_by_msgid();
-void free_request();
-void free_connection();
-void dump_connection();
-void dump_requests_and_responses();
-#endif /* NEEDPROTOS */
-#endif /* LDAP_REFERRALS || LDAP_DNS */
-
-#ifdef LDAP_REFERRALS
-#ifdef NEEDPROTOS
-int chase_referrals( LDAP *ld, LDAPRequest *lr, char **refs, int *count, int samerequest );
-char ** ldap_errormsg2referrals(char *errmsg);
-char *ldap_referral2error_msg(char ** refs);
-int append_referral( LDAP *ld, char **referralsp, char *s );
-#else /* NEEDPROTOS */
-int chase_referrals();
-char ** ldap_errormsg2referrals();
-char *ldap_referral2error_msg();
-int append_referral();
-#endif /* NEEDPROTOS */
-#endif /* LDAP_REFERRALS */
-
-void nsldapi_connection_lost_nolock( LDAP *ld, Sockbuf *sb );
-
-/*
- * in search.c
- */
-#ifdef NEEDPROTOS
-BerElement *ldap_build_search_req( LDAP *ld, char *base, int scope,
- char *filter, char **attrs, int attrsonly, LDAPControl ** serverctrls,
- struct timeval *timeoutp, int sizelimit );
-#else /* NEEDPROTOS */
-BerElement *ldap_build_search_req();
-#endif /* NEEDPROTOS */
-
-static int put_extensible_filter( BerElement *ber, char *type, char *val );
-
-/*
- * in unbind.c
- */
-#ifdef NEEDPROTOS
-int ldap_ld_free( LDAP *ld, int close );
-int send_unbind( LDAP *ld, Sockbuf *sb );
-#else /* NEEDPROTOS */
-int ldap_ld_free();
-int send_unbind();
-#endif /* NEEDPROTOS */
-
-
-#ifdef LDAP_DNS
-/*
- * in getdxbyname.c
- */
-#ifdef NEEDPROTOS
-char **getdxbyname( char *domain );
-#else /* NEEDPROTOS */
-char **getdxbyname();
-#endif /* NEEDPROTOS */
-#endif /* LDAP_DNS */
-
-/*
- * abandon.c
- */
-#ifdef NEEDPROTOS
-BerElement * ldap_build_abandon_req( LDAP *ld, int msgid, LDAPControl ** serverctrls);
-#else
-BerElement * ldap_build_abandon_req();
-#endif
-
-/* add.c */
-#ifdef NEEDPROTOS
-BerElement * ldap_build_add_req(LDAP *ld, char *dn, LDAPMod **attrs, LDAPControl ** serverctrls);
-#else
-BerElement * ldap_build_add_req();
-#endif
-
-/*
- * compare.c
- */
-#ifdef NEEDPROTOS
-BerElement * ldap_build_compare_req(LDAP *ld, char *dn, char *attr, struct berval *bvalue, LDAPControl **serverctrls);
-#else
-BerElement * ldap_build_compare_req();
-#endif
-
-/*
- * delete.c
- */
-#ifdef NEEDPROTOS
-BerElement * ldap_build_delete_req(LDAP *ld, char *dn, LDAPControl **serverctrls);
-#else
-BerElement * ldap_build_delete_req();
-#endif
-
-/*
- * extop.c
- */
-#ifdef NEEDPROTOS
-BerElement * ldap_build_extended_operation_req(LDAP *ld, char *exoid, struct berval *exdata, LDAPControl ** serverctrls);
-#else
-BerElement * ldap_build_extended_operation_req();
-#endif
-
-/*
- * modify.c
- */
-#ifdef NEEDPROTOS
-BerElement * ldap_build_modify_req(LDAP *ld, char *dn, LDAPMod ** mods, LDAPControl **serverctrls);
-#else
-BerElement * ldap_build_modify_req();
-#endif
-
-/*
- * rename.c
- */
-#ifdef NEEDPROTOS
-BerElement * ldap_build_rename_req ( LDAP *ld, char *dn, char *newrdn, char *newparent, int deleteoldrdn, LDAPControl **serverctrls);
-#else
-BerElement * ldap_build_rename_req ();
-#endif
-
-/*
- * saslbind.c
- */
-#ifdef NEEDPROTOS
-BerElement * ldap_build_sasl_bind_req( LDAP *ld, char *dn, char *mechanism, struct berval *creds, LDAPControl ** serverctrls);
-#else
-BerElement * ldap_build_sasl_bind_req();
-#endif
-/*
- * sbind.c
- */
-#ifdef NEEDPROTOS
-BerElement * ldap_build_simple_bind_req(LDAP *ld, char *dn, char *passwd, LDAPControl **serverctrls);
-#else
-BerElement * ldap_build_simple_bind_req();
-#endif
-
-/*
- * utils.c
- */
-
-#ifdef NEEDPROTOS
-void free_strarray(char **sap);
-#else
-void free_strarray();
-#endif
-
-/*
- * Controls.c
- */
-#ifdef NEEDPROTOS
-LDAPControl * ldap_control_dup(LDAPControl *ctrl);
-LDAPControl ** ldap_controls_dup(LDAPControl ** ctrls);
-int ldap_controls_code (BerElement *ber, LDAPControl **ctrls);
-LDAPControl ** ldap_controls_decode(BerElement *ber, int *errcode);
-int ldap_build_control(char *oid, BerElement *ber, int freeber,
- char iscritical, LDAPControl **ctrlp);
-#else
-LDAPControl * ldap_control_dup();
-LDAPControl ** ldap_controls_dup();
-int ldap_controls_code ();
-LDAPControl ** ldap_controls_decode();
-int ldap_build_control();
-#endif
-
-/*
- * ber/io.c
- */
-#ifdef NEEDPROTOS
-int ber_flush(Sockbuf *sb, BerElement *ber, int freeit);
-unsigned int ber_get_next(Sockbuf *sb, unsigned int *len, BerElement *ber);
-#else
-int ber_flush();
-unsigned int ber_get_next();
-#endif
-
diff --git a/usr/src/lib/libldap4/include/ldap-private.h b/usr/src/lib/libldap4/include/ldap-private.h
deleted file mode 100644
index 8cddace292..0000000000
--- a/usr/src/lib/libldap4/include/ldap-private.h
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifndef _LDAP_PRIVATE_H
-#define _LDAP_PRIVATE_H
-
-#include <signal.h>
-#include <pthread.h> /* rri */
-
-#define pthread_self thr_self
-#define thr_self thr_self
-#define pthread_kill thr_kill
-#define thr_kill thr_kill
-
-#ifdef _REENTRANT
-#ifndef MAX_THREAD_ID
-#define MAX_THREAD_ID 500
-#endif /* MAX_THREAD_ID */
-#else /* _REENTRANT */
-#ifndef MAX_THREAD_ID
-#define MAX_THREAD_ID 1
-#endif /* MAX_THREAD_ID */
-#endif /* _REENTRANT */
-
-#define COMPAT20
-#define COMPAT30
-#if defined(COMPAT20) || defined(COMPAT30)
-#define COMPAT
-#endif
-
-#ifdef LDAP_DNS
-#define LDAP_OPT_DNS 0x00000001 /* use DN & DNS */
-#endif /* LDAP_DNS */
-
-/*
-#define DBG_LOCK1(st) printf("%d> %s %d:%s\n", thr_self(), st, __LINE__, __FILE__);
-#define DBG_LOCK2(ld,st) printf("%d> %s ld_lockcount=%d %d:%s\n", thr_self(), st, (ld)->ld_lockcount, __LINE__, __FILE__);
-*/
-#define DBG_LOCK1(st)
-#define DBG_LOCK2(ld,st)
-
-extern pthread_t thr_self();
-#define LOCK_RESPONSE(ld) \
- if ((ld)->ld_response_lockthread != thr_self()) { \
- DBG_LOCK1("waiting for response lock") \
- pthread_mutex_lock( &((ld)->ld_response_mutex) ); \
- DBG_LOCK1("got response lock") \
- (ld)->ld_response_lockthread = thr_self(); \
- } else { \
- (ld)->ld_response_lockcount++; \
- DBG_LOCK2(ld, "fake ldap lock") \
- }
-
-#define UNLOCK_RESPONSE(ld) \
- if ((ld)->ld_response_lockcount==0) { \
- (ld)->ld_response_lockthread = 0; \
- pthread_mutex_unlock( &((ld)->ld_response_mutex) ); \
- DBG_LOCK1("freed response lock") \
- } else { \
- (ld)->ld_response_lockcount--; \
- DBG_LOCK2(ld, "fake ldap unlock") \
- }
-
-#define LOCK_LDAP(ld) \
- if ((ld)->ld_lockthread != thr_self()) { \
- DBG_LOCK1("waiting for ldap lock") \
- pthread_mutex_lock( &((ld)->ld_ldap_mutex) ); \
- DBG_LOCK1("got ldap lock") \
- (ld)->ld_lockthread = thr_self(); \
- } else { \
- (ld)->ld_lockcount++; \
- DBG_LOCK2(ld, "fake ldap lock") \
- }
-
-#define UNLOCK_LDAP(ld) \
- if ((ld)->ld_lockcount==0) { \
- (ld)->ld_lockthread = 0; \
- pthread_mutex_unlock( &((ld)->ld_ldap_mutex) ); \
- DBG_LOCK1("freed ldap lock") \
- } else { \
- (ld)->ld_lockcount--; \
- DBG_LOCK2(ld, "fake ldap unlock") \
- }
-
-#define LOCK_POLL(ld) pthread_mutex_lock( &ld->ld_poll_mutex )
-#define UNLOCK_POLL(ld) pthread_mutex_unlock( &ld->ld_poll_mutex )
-
-
-/*
- * structure representing a Ber Element
- */
-typedef struct berelement {
- char *ber_buf;
- char *ber_ptr;
- char *ber_end;
- struct seqorset *ber_sos;
- unsigned int ber_tag;
- unsigned int ber_len;
- int ber_usertag;
- char ber_options;
-#define LBER_USE_DER 0x01
-#define LBER_USE_INDEFINITE_LEN 0x02
-#define LBER_TRANSLATE_STRINGS 0x04
- char *ber_rwptr;
- BERTranslateProc ber_encode_translate_proc;
- BERTranslateProc ber_decode_translate_proc;
-} _struct_BerElement;
-
-
-/*
- * This structure represents both ldap messages and ldap responses.
- * These are really the same, except in the case of search responses,
- * where a response has multiple messages.
- */
-typedef struct ldapmsg {
- int lm_msgid; /* the message id */
- int lm_msgtype; /* the message type */
- BerElement *lm_ber; /* the ber encoded message contents */
- struct ldapmsg *lm_chain; /* for search - next msg in the resp */
- struct ldapmsg *lm_next; /* next response */
- unsigned long lm_time; /* used to maintain cache */
-} _struct_LDAPMessage;
-
-typedef struct ldap_filt_list {
- char *lfl_tag;
- char *lfl_pattern;
- char *lfl_delims;
- LDAPFiltInfo *lfl_ilist;
- struct ldap_filt_list *lfl_next;
-} _struct_FiltList;
-
-typedef struct ldap_filt_desc {
- LDAPFiltList *lfd_filtlist;
- LDAPFiltInfo *lfd_curfip;
- LDAPFiltInfo lfd_retfi;
- char lfd_filter[ LDAP_FILT_MAXSIZ ];
- char *lfd_curval;
- char *lfd_curvalcopy;
- char **lfd_curvalwords;
- char *lfd_filtprefix;
- char *lfd_filtsuffix;
-} _struct_FiltDesc;
-
-/*
- * structure for tracking LDAP server host, ports, DNs, etc.
- */
-typedef struct ldap_server {
- char *lsrv_host;
- char *lsrv_dn; /* if NULL, use default */
- int lsrv_port;
- struct ldap_server *lsrv_next;
-} LDAPServer;
-
-
-/*
- * structure representing a Socket buffer
- */
-typedef struct sockbuf {
-#ifndef MACOS
- int sb_sd;
-#else /* MACOS */
- void *sb_sd;
-#endif /* MACOS */
- BerElement sb_ber;
-
- int sb_naddr; /* > 0 implies using CLDAP (UDP) */
- void *sb_useaddr; /* pointer to sockaddr to use next */
- void *sb_fromaddr; /* pointer to message source sockaddr */
- void **sb_addrs; /* actually an array of pointers to */
- /* sockaddrs */
-
- int sb_options; /* to support copying ber elements */
-#define LBER_TO_FILE 0x01 /* to a file referenced by sb_fd */
-#define LBER_TO_FILE_ONLY 0x02 /* only write to file, not network */
-#define LBER_MAX_INCOMING_SIZE 0x04 /* impose limit on incoming stuff */
-#define LBER_NO_READ_AHEAD 0x08 /* read only as much as requested */
- int sb_fd;
- int sb_max_incoming;
-#ifdef LDAP_SSL
- int sb_ssl_tls;
- SSL *sb_ssl; /* to support ldap over ssl */
-#endif /* LDAP_SSL */
-} Sockbuf;
-#define READBUFSIZ 8192
-
-
-/*
- * structure for representing an LDAP server connection
- */
-typedef struct ldap_conn {
- Sockbuf *lconn_sb;
- int lconn_refcnt;
- unsigned long lconn_lastused; /* time */
- int lconn_status;
-#define LDAP_CONNST_NEEDSOCKET 1
-#define LDAP_CONNST_CONNECTING 2
-#define LDAP_CONNST_CONNECTED 3
-#define LDAP_CONNST_DEAD 4
- LDAPServer *lconn_server;
- char *lconn_krbinstance;
- struct ldap_conn *lconn_next;
-} LDAPConn;
-
-/*
- * Structure used to keep track of search references
- */
-typedef struct ldap_reference {
- char ** lref_refs;
- struct ldap_reference *lref_next;
-} LDAPRef;
-
-
-
-/*
- * structure used to track outstanding requests
- */
-typedef struct ldapreq {
- int lr_msgid; /* the message id */
- int lr_status; /* status of request */
-#define LDAP_REQST_INPROGRESS 1
-#define LDAP_REQST_CHASINGREFS 2
-#define LDAP_REQST_NOTCONNECTED 3
-#define LDAP_REQST_WRITING 4
-#define LDAP_REQST_CONNDEAD 5
- int lr_outrefcnt; /* count of outstanding referrals */
- int lr_origid; /* original request's message id */
- int lr_parentcnt; /* count of parent requests */
- int lr_res_msgtype; /* result message type */
- int lr_res_errno; /* result LDAP errno */
- char *lr_res_error; /* result error string */
- char *lr_res_matched;/* result matched DN string */
- BerElement *lr_ber; /* ber encoded request contents */
- LDAPConn *lr_conn; /* connection used to send request */
- LDAPRef *lr_references;
- char **lr_ref_followed; /* referral being followed */
- char **lr_ref_unfollowed; /* Not being followed */
- char **lr_ref_tofollow; /* referral to follow if the one being
- followed fails. */
- struct ldapreq *lr_parent; /* request that spawned this referral */
- struct ldapreq *lr_refnext; /* next referral spawned */
- struct ldapreq *lr_prev; /* previous request */
- struct ldapreq *lr_next; /* next request */
-} LDAPRequest;
-
-/*
- * structure for client cache
- */
-#define LDAP_CACHE_BUCKETS 31 /* cache hash table size */
-typedef struct ldapcache {
- LDAPMessage *lc_buckets[LDAP_CACHE_BUCKETS];/* hash table */
- LDAPMessage *lc_requests; /* unfulfilled reqs */
- time_t lc_timeout; /* request timeout */
- ssize_t lc_maxmem; /* memory to use */
- ssize_t lc_memused; /* memory in use */
- int lc_enabled; /* enabled? */
- unsigned int lc_options; /* options */
-#define LDAP_CACHE_OPT_CACHENOERRS 0x00000001
-#define LDAP_CACHE_OPT_CACHEALLERRS 0x00000002
-} LDAPCache;
-#define NULLLDCACHE ((LDAPCache *)NULL)
-
-/*
- * structure representing an ldap connection
- */
-typedef struct ldap {
- Sockbuf ld_sb; /* socket descriptor & buffer */
- char *ld_host;
- int ld_version;
- char ld_lberoptions;
- int ld_deref;
-
- int ld_timelimit;
- int ld_sizelimit;
-
- LDAPFiltDesc *ld_filtd; /* from getfilter for ufn searches */
- char *ld_ufnprefix; /* for incomplete ufn's */
-
- int ld_errno[MAX_THREAD_ID]; /* thread-specific */
-#define ld_errno ld_errno[ldap_thr_index()]
- char *ld_error[MAX_THREAD_ID]; /* thread-specific */
-#define ld_error ld_error[ldap_thr_index()]
- char *ld_matched[MAX_THREAD_ID]; /* thread-specific */
-#define ld_matched ld_matched[ldap_thr_index()]
- char **ld_referrals[MAX_THREAD_ID]; /* thread-specific */
-#define ld_referrals ld_referrals[ldap_thr_index()]
- LDAPControl **ld_ret_ctrls[MAX_THREAD_ID]; /* thread-specific */
-#define ld_ret_ctrls ld_ret_ctrls[ldap_thr_index()]
- int ld_msgid;
-
- int ld_follow_referral; /* flag set to true if lib follow referrals */
- LDAPRequest *ld_requests; /* list of outstanding requests -- referrals*/
-
- LDAPMessage *ld_responses; /* list of outstanding responses */
- int *ld_abandoned; /* array of abandoned requests */
-
- pthread_mutex_t ld_response_mutex; /* mutex for responses part of structure */
- pthread_t ld_response_lockthread; /* thread which currently holds the response lock */
- int ld_response_lockcount; /* response lock depth */
-
- char *ld_attrbuffer[MAX_THREAD_ID];
-#define ld_attrbuffer ld_attrbuffer[ldap_thr_index()]
- LDAPCache *ld_cache; /* non-null if cache is initialized */
- char *ld_cldapdn; /* DN used in connectionless search */
-
- /* it is OK to change these next four values directly */
- int ld_cldaptries; /* connectionless search retry count */
- int ld_cldaptimeout;/* time between retries */
- int ld_refhoplimit; /* limit on referral nesting */
-/* LP TO CHANGE */
- char ld_restart;
-#ifdef LDAP_SSL
- int ld_use_ssl;
- char *ld_ssl_key;
-#endif
- unsigned int ld_options; /* boolean options */
-
- /* do not mess with the rest though */
- char *ld_defhost; /* full name of default server */
- int ld_defport; /* port of default server */
- BERTranslateProc ld_lber_encode_translate_proc;
- BERTranslateProc ld_lber_decode_translate_proc;
-
- LDAPConn *ld_defconn; /* default connection */
- LDAPConn *ld_conns; /* list of server connections */
- void *ld_selectinfo; /* platform specifics for select */
-
- LDAP_REBIND_FUNCTION *ld_rebindproc;
- void *ld_rebind_extra_arg;
-/* int (*ld_rebindproc)( struct ldap *ld, char **dnp, */
-/* char **passwdp, int *authmethodp, int freeit ); */
- /* routine to get info needed for re-bind */
-
- pthread_mutex_t ld_ldap_mutex; /* mutex for thread dependent part of struct */
- pthread_t ld_lockthread; /* thread which currently holds the lock */
- int ld_lockcount; /* lock depth */
- pthread_mutex_t ld_poll_mutex; /* a seperate lock for polling */
-
- LDAPControl **ld_srvctrls; /* Controls used by ldap and server */
- LDAPControl **ld_cltctrls; /* Client side controls */
-
-/* KE: Lists of unsolicited notifications */
- LDAPMessage *ld_notifs[MAX_THREAD_ID];
-
- /* How long to wait for while connecting to a server */
- int ld_connect_timeout;
-#define ld_notifs ld_notifs[ldap_thr_index()]
-} _struct_LDAP;
-
-
-/*
- * handy macro to check whether LDAP struct is set up for CLDAP or not
- */
-#define LDAP_IS_CLDAP( ld ) ( ld->ld_sb.sb_naddr > 0 )
-
-
-#endif /* _LDAP_PRIVATE_H */
diff --git a/usr/src/lib/libldap4/include/ldap.h b/usr/src/lib/libldap4/include/ldap.h
deleted file mode 100644
index a5a0a61534..0000000000
--- a/usr/src/lib/libldap4/include/ldap.h
+++ /dev/null
@@ -1,1375 +0,0 @@
-/*
- * Copyright (c) 2001 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-/*
- * Copyright (c) 1990 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
-#ifndef _LDAP_H
-#define _LDAP_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef LDAP_SSL
-#include <security/ssl.h>
-#endif /* LDAP_SSL */
-
-
-#include <pthread.h>
-
-#ifdef LDAP_SSL
-#define SSL_LDAP_PORT 636
-#endif
-
-#if !defined(NEEDPROTOS) && defined(__STDC__)
-#define NEEDPROTOS 1
-#endif
-
-#define LDAP_API_VERSION 2004
-#define LDAP_VERSION_MIN 2
-#define LDAP_VERSION_MAX 3
-#define LDAP_VENDOR_NAME "Sun Microsystems Inc."
-#define LDAP_VENDOR_VERSION 400
-
-#define LDAP_PORT 389
-#define LDAP_VERSION1 1
-#define LDAP_VERSION2 2
-#define LDAP_VERSION3 3
-#define LDAP_VERSION LDAP_VERSION2
-
-/* OPTIONS to use with ldap_set_option and ldap_get_option */
-#define LDAP_OPT_API_INFO 0x00
-#define LDAP_OPT_DESC 0x01 /* Use of this option is depricated */
-/* int, control how aliases are handled during search */
-#define LDAP_OPT_DEREF 0x02
-/* Deref values */
-#define LDAP_DEREF_NEVER 0x00
-#define LDAP_DEREF_SEARCHING 0x01
-#define LDAP_DEREF_FINDING 0x02
-#define LDAP_DEREF_ALWAYS 0x03
-
-#define LDAP_OPT_SIZELIMIT 0x03 /* int, size limit of a search */
-#define LDAP_OPT_TIMELIMIT 0x04 /* int, time limit of a search */
-#define LDAP_OPT_REBIND_FN 0x06 /* Use of this options is depricated */
-#define LDAP_OPT_REBIND_ARG 0x07 /* Use of this options is depricated */
-#define LDAP_OPT_REFERRALS 0x08 /* ON/OFF, chase referrals */
-#define LDAP_OPT_RESTART 0x09 /* ON/OFF, restart if EINTR occurs */
-/* int, protocol version, default 2 */
-#define LDAP_OPT_PROTOCOL_VERSION 0x11
-/* List of ldap controls to be sent with each request */
-#define LDAP_OPT_SERVER_CONTROLS 0x12
-/* List of ldap controls that affect the session */
-#define LDAP_OPT_CLIENT_CONTROLS 0x13
-#define LDAP_OPT_API_FEATURE_INFO 0x15
-/* The hostname of the default ldap server */
-#define LDAP_OPT_HOST_NAME 0x30
-/* The code of the most recent ldap error that occured for this session */
-#define LDAP_OPT_ERROR_NUMBER 0x31
-/* The message returned with the most recent ldap error */
-#define LDAP_OPT_ERROR_STRING 0x32
-/* The Matching DN in case of a naming error */
-#define LDAP_OPT_MATCHED_DN 0x33
-#define LDAP_OPT_ERROR_MATCHED 0x33 /* Use of this options is depricated */
-
-/* The timeout while trying to connect to a server */
-#define LDAP_X_OPT_CONNECT_TIMEOUT 0x4F01
-#define LDAP_X_IO_TIMEOUT_NO_WAIT 0
-#define LDAP_X_IO_TIMEOUT_NO_TIMEOUT -1
-
-/* The Filter List Desc used by UFN functions */
-/* #define LDAP_OPT_FILTERDESC 0x80 */
-/* For on/off options */
-#define LDAP_OPT_ON ((void *)1)
-#define LDAP_OPT_OFF ((void *)0)
-
-/* Used for NO limitation is TIMELIMIT or SIZELIMIT */
-#define LDAP_NO_LIMIT 0
-
-#define LDAP_MAX_ATTR_LEN 100
-#define LDAP_RETURN_NO_ATTR "1.1"
-#define LDAP_RETURN_ALL_ATTR ""
-#define LDAP_RETURN_ALL_ATTR_OPS "*"
-
-/* Begin LDAP Display Template Definitions */
-#define LDAP_TEMPLATE_VERSION 1
-
-/*
- * general types of items (confined to most significant byte)
- */
-#define LDAP_SYN_TYPE_TEXT 0x01000000
-#define LDAP_SYN_TYPE_IMAGE 0x02000000
-#define LDAP_SYN_TYPE_BOOLEAN 0x04000000
-#define LDAP_SYN_TYPE_BUTTON 0x08000000
-#define LDAP_SYN_TYPE_ACTION 0x10000000
-
-/*
- * syntax options (confined to second most significant byte)
- */
-#define LDAP_SYN_OPT_DEFER 0x00010000
-
-
-/*
- * display template item syntax ids (defined by common agreement)
- * these are the valid values for the ti_syntaxid of the tmplitem
- * struct (defined below). A general type is encoded in the
- * most-significant 8 bits, and some options are encoded in the next
- * 8 bits. The lower 16 bits are reserved for the distinct types.
- */
-#define LDAP_SYN_CASEIGNORESTR (1 | LDAP_SYN_TYPE_TEXT)
-#define LDAP_SYN_MULTILINESTR (2 | LDAP_SYN_TYPE_TEXT)
-#define LDAP_SYN_DN (3 | LDAP_SYN_TYPE_TEXT)
-#define LDAP_SYN_BOOLEAN (4 | LDAP_SYN_TYPE_BOOLEAN)
-#define LDAP_SYN_JPEGIMAGE (5 | LDAP_SYN_TYPE_IMAGE)
-#define LDAP_SYN_JPEGBUTTON (6 | LDAP_SYN_TYPE_BUTTON | \
- LDAP_SYN_OPT_DEFER)
-#define LDAP_SYN_FAXIMAGE (7 | LDAP_SYN_TYPE_IMAGE)
-#define LDAP_SYN_FAXBUTTON (8 | LDAP_SYN_TYPE_BUTTON | \
- LDAP_SYN_OPT_DEFER)
-#define LDAP_SYN_AUDIOBUTTON (9 | LDAP_SYN_TYPE_BUTTON | \
- LDAP_SYN_OPT_DEFER)
-#define LDAP_SYN_TIME (10 | LDAP_SYN_TYPE_TEXT)
-#define LDAP_SYN_DATE (11 | LDAP_SYN_TYPE_TEXT)
-#define LDAP_SYN_LABELEDURL (12 | LDAP_SYN_TYPE_TEXT)
-#define LDAP_SYN_SEARCHACTION (13 | LDAP_SYN_TYPE_ACTION)
-#define LDAP_SYN_LINKACTION (14 | LDAP_SYN_TYPE_ACTION)
-#define LDAP_SYN_ADDDNACTION (15 | LDAP_SYN_TYPE_ACTION)
-#define LDAP_SYN_VERIFYDNACTION (16 | LDAP_SYN_TYPE_ACTION)
-#define LDAP_SYN_RFC822ADDR (17 | LDAP_SYN_TYPE_TEXT)
-#ifdef SUN
-#define LDAP_SYN_PROTECTED (18 | LDAP_SYN_TYPE_TEXT)
-#endif
-
-/*
- * handy macros
- */
-#define LDAP_GET_SYN_TYPE(syid) ((syid) & 0xFF000000)
-#define LDAP_GET_SYN_OPTIONS(syid) ((syid) & 0x00FF0000)
-
-/*
- * display options for output routines (used by entry2text and friends)
- */
-/*
- * use calculated label width (based on length of longest label in
- * template) instead of contant width
- */
-#define LDAP_DISP_OPT_AUTOLABELWIDTH 0x00000001
-#define LDAP_DISP_OPT_HTMLBODYONLY 0x00000002
-
-/*
- * perform search actions (applies to ldap_entry2text_search only)
- */
-#define LDAP_DISP_OPT_DOSEARCHACTIONS 0x00000002
-
-/*
- * include additional info. relevant to "non leaf" entries only
- * used by ldap_entry2html and ldap_entry2html_search to include "Browse"
- * and "Move Up" HREFs
- */
-#define LDAP_DISP_OPT_NONLEAF 0x00000004
-
-
-/*
- * display template item options (may not apply to all types)
- * if this bit is set in ti_options, it applies.
- */
-#define LDAP_DITEM_OPT_READONLY 0x00000001
-#define LDAP_DITEM_OPT_SORTVALUES 0x00000002
-#define LDAP_DITEM_OPT_SINGLEVALUED 0x00000004
-#define LDAP_DITEM_OPT_HIDEIFEMPTY 0x00000008
-#define LDAP_DITEM_OPT_VALUEREQUIRED 0x00000010
-#define LDAP_DITEM_OPT_HIDEIFFALSE 0x00000020 /* booleans only */
-
-
-/*
- * LDAP API Information structure
- */
-typedef struct ldapapiinfo {
- int ldapai_info_version; /* version of this struct (1) */
- int ldapai_api_version; /* revision of API supported */
- int ldapai_protocol_version; /* highest LDAP version supported */
- char **ldapai_extensions; /* names of API extensions */
- char *ldapai_vendor_name; /* name of supplier */
- int ldapai_vendor_version; /* supplier-specific version * 100 */
-} LDAPAPIInfo;
-#define LDAP_API_INFO_VERSION 1
-
-
-/*
- * LDAP API Feature Information
- */
-typedef struct ldap_apifeature_info {
- int ldapaif_info_version; /* version of this struct (1) */
- char *ldapaif_name; /* name of supported feature */
- int ldapaif_version; /* revision of supported feature */
-} LDAPAPIFeatureInfo;
-#define LDAP_FEATURE_INFO_VERSION 1
-
-
-/*
- * display template item structure
- */
-struct ldap_tmplitem {
- unsigned int ti_syntaxid;
- unsigned int ti_options;
- char *ti_attrname;
- char *ti_label;
- char **ti_args;
- struct ldap_tmplitem *ti_next_in_row;
- struct ldap_tmplitem *ti_next_in_col;
- void *ti_appdata;
-};
-
-
-#define NULLTMPLITEM ((struct ldap_tmplitem *)0)
-
-#define LDAP_SET_TMPLITEM_APPDATA(ti, datap) \
- (ti)->ti_appdata = (void *)(datap)
-
-#define LDAP_GET_TMPLITEM_APPDATA(ti, type) \
- (type)((ti)->ti_appdata)
-
-
-#define LDAP_IS_TMPLITEM_OPTION_SET(ti, option) \
- (((ti)->ti_options & option) != 0)
-
-
-/*
- * object class array structure
- */
-struct ldap_oclist {
- char **oc_objclasses;
- struct ldap_oclist *oc_next;
-};
-
-#define NULLOCLIST ((struct ldap_oclist *)0)
-
-
-/*
- * add defaults list
- */
-struct ldap_adddeflist {
- int ad_source;
-#define LDAP_ADSRC_CONSTANTVALUE 1
-#define LDAP_ADSRC_ADDERSDN 2
- char *ad_attrname;
- char *ad_value;
- struct ldap_adddeflist *ad_next;
-};
-
-#define NULLADLIST ((struct ldap_adddeflist *)0)
-
-
-/*
- * display template global options
- * if this bit is set in dt_options, it applies.
- */
-/*
- * users should be allowed to try to add objects of these entries
- */
-#define LDAP_DTMPL_OPT_ADDABLE 0x00000001
-
-/*
- * users should be allowed to do "modify RDN" operation of these entries
- */
-#define LDAP_DTMPL_OPT_ALLOWMODRDN 0x00000002
-
-/*
- * this template is an alternate view, not a primary view
- */
-#define LDAP_DTMPL_OPT_ALTVIEW 0x00000004
-
-
-/*
- * display template structure
- */
-struct ldap_disptmpl {
- char *dt_name;
- char *dt_pluralname;
- char *dt_iconname;
- unsigned int dt_options;
- char *dt_authattrname;
- char *dt_defrdnattrname;
- char *dt_defaddlocation;
- struct ldap_oclist *dt_oclist;
- struct ldap_adddeflist *dt_adddeflist;
- struct ldap_tmplitem *dt_items;
- void *dt_appdata;
- struct ldap_disptmpl *dt_next;
-};
-
-#define NULLDISPTMPL ((struct ldap_disptmpl *)0)
-
-#define LDAP_SET_DISPTMPL_APPDATA(dt, datap) \
- (dt)->dt_appdata = (void *)(datap)
-
-#define LDAP_GET_DISPTMPL_APPDATA(dt, type) \
- (type)((dt)->dt_appdata)
-
-#define LDAP_IS_DISPTMPL_OPTION_SET(dt, option) \
- (((dt)->dt_options & option) != 0)
-
-#define LDAP_TMPL_ERR_VERSION 1
-#define LDAP_TMPL_ERR_MEM 2
-#define LDAP_TMPL_ERR_SYNTAX 3
-#define LDAP_TMPL_ERR_FILE 4
-
-/*
- * buffer size needed for entry2text and vals2text
- */
-#define LDAP_DTMPL_BUFSIZ 8192
-
-/* END Display Template Definitions */
-
-/* BEGIN Search Prefrences Definitions */
-
-struct ldap_searchattr {
- char *sa_attrlabel;
- char *sa_attr;
- /* max 32 matchtypes for now */
- unsigned int sa_matchtypebitmap;
- char *sa_selectattr;
- char *sa_selecttext;
- struct ldap_searchattr *sa_next;
-};
-
-struct ldap_searchmatch {
- char *sm_matchprompt;
- char *sm_filter;
- struct ldap_searchmatch *sm_next;
-};
-
-struct ldap_searchobj {
- char *so_objtypeprompt;
- unsigned int so_options;
- char *so_prompt;
- short so_defaultscope;
- char *so_filterprefix;
- char *so_filtertag;
- char *so_defaultselectattr;
- char *so_defaultselecttext;
- struct ldap_searchattr *so_salist;
- struct ldap_searchmatch *so_smlist;
- struct ldap_searchobj *so_next;
-};
-
-#define NULLSEARCHOBJ ((struct ldap_searchobj *)0)
-
-/*
- * global search object options
- */
-#define LDAP_SEARCHOBJ_OPT_INTERNAL 0x00000001
-
-#define LDAP_IS_SEARCHOBJ_OPTION_SET(so, option) \
- (((so)->so_options & option) != 0)
-
-#define LDAP_SEARCHPREF_VERSION_ZERO 0
-#define LDAP_SEARCHPREF_VERSION 1
-
-#define LDAP_SEARCHPREF_ERR_VERSION 1
-#define LDAP_SEARCHPREF_ERR_MEM 2
-#define LDAP_SEARCHPREF_ERR_SYNTAX 3
-#define LDAP_SEARCHPREF_ERR_FILE 4
-
-
-/* END Search Prefrences Definitions */
-
-/*
- * Structure for LDAP modifications
- */
-typedef struct ldapmod {
- int mod_op;
-#define LDAP_MOD_ADD 0x00
-#define LDAP_MOD_DELETE 0x01
-#define LDAP_MOD_REPLACE 0x02
-#define LDAP_MOD_BVALUES 0x80
- char *mod_type;
- union {
- char **modv_strvals;
- struct berval **modv_bvals;
- } mod_vals;
-#define mod_values mod_vals.modv_strvals
-#define mod_bvalues mod_vals.modv_bvals
-/*
- * The following field is commented out since no functions use it in
- * the library and also not part of c-api draft.
- */
-/* struct ldapmod *mod_next */
-} LDAPMod;
-
-typedef struct ldap LDAP; /* Opaque LDAP connection handle */
-
-typedef struct ldapmsg LDAPMessage; /* Opaque Result / Entry handle */
-
-#define NULLMSG ((LDAPMessage *) NULL)
-
-/* Call back to get info needed for re-bind */
-typedef int (LDAP_REBIND_FUNCTION)(LDAP *ld, char **dn, char **passwd,
- int *authmethod, int freeit, void *extraArg);
-
-/*
- * structures for ldap getfilter routines
- */
-
-typedef struct ldap_filt_info {
- char *lfi_filter;
- char *lfi_desc;
- int lfi_scope; /* LDAP_SCOPE_BASE, etc */
- int lfi_isexact; /* exact match filter? */
- struct ldap_filt_info *lfi_next;
-} LDAPFiltInfo;
-
-
-#define LDAP_FILT_MAXSIZ 1024
-
-typedef struct ldap_filt_list LDAPFiltList;
-typedef struct ldap_filt_desc LDAPFiltDesc;
-
-
-/*
- * Simple Page control OID
- */
-#define LDAP_CONTROL_SIMPLE_PAGE "1.2.840.113556.1.4.319"
-
-/*
- * Server Sort Control
- */
-#define LDAP_CONTROL_SORTREQUEST "1.2.840.113556.1.4.473"
-#define LDAP_CONTROL_SORTRESPONSE "1.2.840.113556.1.4.474"
-/*
- * structure for a sort-key
- */
-typedef struct LDAPsortkey {
- char *sk_attrtype;
- char *sk_matchruleoid;
- int sk_reverseorder;
-} LDAPsortkey;
-
-/*
- * Virtual List View (vlv) control
- */
-#define LDAP_CONTROL_VLVREQUEST "2.16.840.1.113730.3.4.9"
-#define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
-/*
- * structure that describes a VirtualListViewRequest control.
- * note that ldvlist_index and ldvlist_size are only relevant to
- * ldap_create_virtuallist_control() if ldvlist_attrvalue is NULL.
- */
-typedef struct ldapvirtuallist {
- unsigned long ldvlist_before_count; /* # entries before target */
- unsigned long ldvlist_after_count; /* # entries after target */
- char *ldvlist_attrvalue; /* jump to this value */
- unsigned long ldvlist_index; /* list offset */
- unsigned long ldvlist_size; /* number of items in vlist */
- void *ldvlist_extradata; /* for use by application */
-} LDAPVirtualList;
-
-/*
- * ldapv3 LDAPControl
- */
-typedef struct ldapcontrol
-{
- char *ldctl_oid;
-/*
- * the "ldctl_value" field of this structure used to be a pointer to
- * struct berval. To make this structure compliant to the latest c-api
- * draft, it is changed to "struct berval ldctl_value"
- */
- struct berval ldctl_value;
- char ldctl_iscritical;
-} LDAPControl, *PLDAPControl;
-
-/*
- * specific LDAP instantiations of BER types we know about
- */
-
-/* general stuff */
-#define LDAP_TAG_MESSAGE 0x30 /* tag is 16 + constructed bit */
-#define LDAP_TAG_MSGID 0x02
-#define LDAP_TAG_CONTROL_LIST 0xA0 /* Context 0 + constructed */
-#define LDAP_TAG_REFERRAL 0xA3 /* Context 3 + constructed */
-#define LDAP_TAG_SASLCREDS 0x87 /* Context 7 + primitive */
-#define LDAP_TAG_AUTH_SIMPLE 0x80 /* Context 0 + primitive */
-#define LDAP_TAG_AUTH_SASL 0xA3 /* Context 3 + constructed */
-/* Tag for modrdn request */
-#define LDAP_TAG_NEWPARENT 0x80 /* Context 0 + primitive */
-/* Tags for Extensible filter match */
-#define LDAP_TAG_FEXT_RULE 0x81 /* Context 1 + primitive */
-#define LDAP_TAG_FEXT_TYPE 0x82 /* Context 2 + primitive */
-#define LDAP_TAG_FEXT_VAL 0x83 /* Context 3 + primitive */
-#define LDAP_TAG_FEXT_DN 0x84 /* Context 4 + primitive */
-/* tags for EXTENDED OPERATIONS */
-#define LDAP_TAG_EXT_NAME 0x80 /* Context 0 + primitive */
-#define LDAP_TAG_EXT_VAL 0x81 /* Context 1 + primitive */
-#define LDAP_TAG_EXT_RESPNAME 0x8a /* Context 10 + primitive */
-#define LDAP_TAG_EXT_RESPONSE 0x8b /* Context 11 + primitive */
-/* tags for Virtual List View control */
-#define LDAP_TAG_VLV_BY_INDEX 0xa0 /* context specific + constructed + 0 */
-#define LDAP_TAG_VLV_BY_VALUE 0x81 /* context specific + primitive + 1 */
-/* tag for sort control */
-#define LDAP_TAG_SK_MATCHRULE 0x80L /* context specific + primitive */
-#define LDAP_TAG_SK_REVERSE 0x81L /* context specific + primitive */
-#define LDAP_TAG_SR_ATTRTYPE 0x80L /* context specific + primitive */
-
-/* possible operations a client can invoke */
-#define LDAP_REQ_BIND 0x60 /* application + constructed */
-#define LDAP_REQ_UNBIND 0x42 /* application + primitive */
-#define LDAP_REQ_SEARCH 0x63 /* application + constructed */
-#define LDAP_REQ_MODIFY 0x66 /* application + constructed */
-#define LDAP_REQ_ADD 0x68 /* application + constructed */
-#define LDAP_REQ_DELETE 0x4a /* application + primitive */
-#define LDAP_REQ_MODRDN 0x6c /* application + constructed */
-#define LDAP_REQ_COMPARE 0x6e /* application + constructed */
-#define LDAP_REQ_ABANDON 0x50 /* application + primitive */
-/* New in ldapv3 application + constructed */
-#define LDAP_REQ_EXTENDED 0x77
-/* version 3.0 compatibility stuff */
-#define LDAP_REQ_UNBIND_30 0x62
-#define LDAP_REQ_DELETE_30 0x6a
-#define LDAP_REQ_ABANDON_30 0x70
-
-/* possible result types a server can return */
-#define LDAP_RES_BIND 0x61 /* application + constructed */
-#define LDAP_RES_SEARCH_ENTRY 0x64 /* application + constructed */
-/* new in ldapv3, application + constructed */
-#define LDAP_RES_SEARCH_REFERENCE 0x73
-#define LDAP_RES_SEARCH_RESULT 0x65 /* application + constructed */
-#define LDAP_RES_MODIFY 0x67 /* application + constructed */
-#define LDAP_RES_ADD 0x69 /* application + constructed */
-#define LDAP_RES_DELETE 0x6b /* application + constructed */
-#define LDAP_RES_MODRDN 0x6d /* application + constructed */
-#define LDAP_RES_COMPARE 0x6f /* application + constructed */
-/* new in ldapv3, application + constructed */
-#define LDAP_RES_EXTENDED 0x78
-#define LDAP_RES_ANY (-1)
-
-/* authentication methods available */
-#define LDAP_AUTH_NONE 0x00 /* no authentication */
-#define LDAP_AUTH_SIMPLE 0x80 /* context specific + primitive */
-#define LDAP_AUTH_KRBV4 0xff /* means do both of the following */
-#define LDAP_AUTH_KRBV41 0x81 /* context specific + primitive */
-#define LDAP_AUTH_KRBV42 0x82 /* context specific + primitive */
-/* New with ldapv3 */
-#define LDAP_AUTH_SASL 0xa3 /* context specific + constructed */
-
-/* 3.0 compatibility auth methods */
-#define LDAP_AUTH_SIMPLE_30 0xa0 /* context specific + constructed */
-#define LDAP_AUTH_KRBV41_30 0xa1 /* context specific + constructed */
-#define LDAP_AUTH_KRBV42_30 0xa2 /* context specific + constructed */
-
-/* filter types */
-#define LDAP_FILTER_AND 0xa0 /* context specific + constructed */
-#define LDAP_FILTER_OR 0xa1 /* context specific + constructed */
-#define LDAP_FILTER_NOT 0xa2 /* context specific + constructed */
-#define LDAP_FILTER_EQUALITY 0xa3 /* context specific + constructed */
-#define LDAP_FILTER_SUBSTRINGS 0xa4 /* context specific + constructed */
-#define LDAP_FILTER_GE 0xa5 /* context specific + constructed */
-#define LDAP_FILTER_LE 0xa6 /* context specific + constructed */
-#define LDAP_FILTER_PRESENT 0x87 /* context specific + primitive */
-#define LDAP_FILTER_APPROX 0xa8 /* context specific + constructed */
-#define LDAP_FILTER_EXTENSIBLE 0xa9 /* context specific + constructed */
-
-/* 3.0 compatibility filter types */
-#define LDAP_FILTER_PRESENT_30 0xa7 /* context specific + constructed */
-
-/* substring filter component types */
-#define LDAP_SUBSTRING_INITIAL 0x80 /* context specific */
-#define LDAP_SUBSTRING_ANY 0x81 /* context specific */
-#define LDAP_SUBSTRING_FINAL 0x82 /* context specific */
-
-/* 3.0 compatibility substring filter component types */
-#define LDAP_SUBSTRING_INITIAL_30 0xa0 /* context specific */
-#define LDAP_SUBSTRING_ANY_30 0xa1 /* context specific */
-#define LDAP_SUBSTRING_FINAL_30 0xa2 /* context specific */
-
-/* search scopes */
-#define LDAP_SCOPE_BASE 0x00
-#define LDAP_SCOPE_ONELEVEL 0x01
-#define LDAP_SCOPE_SUBTREE 0x02
-/* Used when parsing URL, if scope not found. *LDAP_SCOPE_BASE is to use then */
-#define LDAP_SCOPE_UNKNOWN 0xFF
-
-/* ldap_result number of messages that should be returned */
-#define LDAP_MSG_ONE 0x00
-#define LDAP_MSG_ALL 0x01
-#define LDAP_MSG_RECEIVED 0x02
-
-
-/* default limit on nesting of referrals */
-#define LDAP_DEFAULT_REFHOPLIMIT 5
-
-
-/* SASL mechanisms */
-#define LDAP_SASL_SIMPLE ""
-#define LDAP_SASL_CRAM_MD5 "CRAM-MD5"
-#define LDAP_SASL_EXTERNAL "EXTERNAL"
-/* Next ones are not supported so far by SunDS 2.0 */
-#define LDAP_SASL_X511_PROTECTED "X.511-Protected"
-#define LDAP_SASL_X511_STRONG "X.511-Strong"
-#define LDAP_SASL_KERBEROS_V4 "KERBEROS_V4"
-#define LDAP_SASL_GSSAPI "GSSAPI"
-#define LDAP_SASL_SKEY "SKEY"
-
-/*
- * structure for ldap friendly mapping routines
- */
-
-typedef struct friendly {
- char *f_unfriendly;
- char *f_friendly;
-} FriendlyMap;
-
-
-/*
- * Structures for URL handling
- */
-typedef struct ldap_url_extension {
- char *lue_type;
- char *lue_value;
- int lue_iscritical;
-} LDAPURLExt;
-
-typedef struct ldap_url_desc {
- char *lud_host;
- int lud_port;
- char *lud_dn;
- char **lud_attrs;
- int lud_scope;
- char *lud_filter;
- LDAPURLExt **lud_extensions;
- char *lud_string; /* for internal use only */
-} LDAPURLDesc;
-
-#define NULLLDAPURLDESC ((LDAPURLDesc *)NULL)
-
-#define LDAP_URL_ERR_NOTLDAP 1 /* URL doesn't begin with "ldap://" */
-#define LDAP_URL_ERR_NODN 2 /* URL has no DN (required) */
-#define LDAP_URL_ERR_BADSCOPE 3 /* URL scope string is invalid */
-#define LDAP_URL_ERR_MEM 4 /* can't allocate memory space */
-
-
-/*
- * possible error codes we can return
- */
-
-#define LDAP_SUCCESS 0x00
-#define LDAP_OPERATIONS_ERROR 0x01
-#define LDAP_PROTOCOL_ERROR 0x02
-#define LDAP_TIMELIMIT_EXCEEDED 0x03
-#define LDAP_SIZELIMIT_EXCEEDED 0x04
-#define LDAP_COMPARE_FALSE 0x05
-#define LDAP_COMPARE_TRUE 0x06
-#define LDAP_AUTH_METHOD_NOT_SUPPORTED 0x07
-#define LDAP_STRONG_AUTH_REQUIRED 0x08
-/* Not used in ldapv3 */
-#define LDAP_PARTIAL_RESULTS 0x09
-
-/* New in ldapv3 */
-#define LDAP_REFERRAL 0x0a
-#define LDAP_ADMINLIMIT_EXCEEDED 0x0b
-#define LDAP_UNAVAILABLE_CRITICAL_EXTENSION 0x0c
-#define LDAP_CONFIDENTIALITY_REQUIRED 0x0d
-#define LDAP_SASL_BIND_INPROGRESS 0x0e
-/* End of new */
-
-#define LDAP_NO_SUCH_ATTRIBUTE 0x10
-#define LDAP_UNDEFINED_TYPE 0x11
-#define LDAP_INAPPROPRIATE_MATCHING 0x12
-#define LDAP_CONSTRAINT_VIOLATION 0x13
-#define LDAP_TYPE_OR_VALUE_EXISTS 0x14
-#define LDAP_INVALID_SYNTAX 0x15
-
-#define ATTRIBUTE_ERROR(n) ((n & 0xf0) == 0x10)
-
-#define LDAP_NO_SUCH_OBJECT 0x20
-#define LDAP_ALIAS_PROBLEM 0x21
-#define LDAP_INVALID_DN_SYNTAX 0x22
-/* Following in not used in ldapv3 */
-#define LDAP_IS_LEAF 0x23
-#define LDAP_ALIAS_DEREF_PROBLEM 0x24
-
-#define NAME_ERROR(n) ((n & 0xf0) == 0x20)
-
-#define LDAP_INAPPROPRIATE_AUTH 0x30
-#define LDAP_INVALID_CREDENTIALS 0x31
-#define LDAP_INSUFFICIENT_ACCESS 0x32
-#define LDAP_BUSY 0x33
-#define LDAP_UNAVAILABLE 0x34
-#define LDAP_UNWILLING_TO_PERFORM 0x35
-#define LDAP_LOOP_DETECT 0x36
-
-#define LDAP_SORT_CONTROL_MISSING 0x3C /* 60 */
-#define LDAP_INDEX_RANGE_ERROR 0x3D /* 61 */
-
-#define LDAP_NAMING_VIOLATION 0x40
-#define LDAP_OBJECT_CLASS_VIOLATION 0x41
-#define LDAP_NOT_ALLOWED_ON_NONLEAF 0x42
-#define LDAP_NOT_ALLOWED_ON_RDN 0x43
-#define LDAP_ALREADY_EXISTS 0x44
-#define LDAP_NO_OBJECT_CLASS_MODS 0x45
-#define LDAP_RESULTS_TOO_LARGE 0x46
-/* Following is new in ldapv3 */
-#define LDAP_AFFECTS_MULTIPLE_DSAS 0x47
-#define LDAP_OTHER 0x50
-
-/* Reserved for API */
-#define LDAP_SERVER_DOWN 0x51
-#define LDAP_LOCAL_ERROR 0x52
-#define LDAP_ENCODING_ERROR 0x53
-#define LDAP_DECODING_ERROR 0x54
-#define LDAP_TIMEOUT 0x55
-#define LDAP_AUTH_UNKNOWN 0x56
-#define LDAP_FILTER_ERROR 0x57
-#define LDAP_USER_CANCELLED 0x58
-#define LDAP_PARAM_ERROR 0x59
-#define LDAP_NO_MEMORY 0x5a
-
-/* New code with ldapv3 ? */
-#define LDAP_CONNECT_ERROR 0x5b
-#define LDAP_NOT_SUPPORTED 0x5c
-#define LDAP_CONTROL_NOT_FOUND 0x5d
-#define LDAP_NO_RESULTS_RETURNED 0x5e
-#define LDAP_MORE_RESULTS_TO_RETURN 0x5f
-#define LDAP_CLIENT_LOOP 0x60
-#define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61
-
-/* debugging stuff */
-#ifdef LDAP_DEBUG
-extern int ldap_debug;
-#ifdef LDAP_SYSLOG
-extern int ldap_syslog;
-extern int ldap_syslog_level;
-#endif
-#define LDAP_DEBUG_TRACE 0x001
-#define LDAP_DEBUG_PACKETS 0x002
-#define LDAP_DEBUG_ARGS 0x004
-#define LDAP_DEBUG_CONNS 0x008
-#define LDAP_DEBUG_BER 0x010
-#define LDAP_DEBUG_FILTER 0x020
-#define LDAP_DEBUG_CONFIG 0x040
-#define LDAP_DEBUG_ACL 0x080
-#define LDAP_DEBUG_STATS 0x100
-#define LDAP_DEBUG_STATS2 0x200
-#define LDAP_DEBUG_SHELL 0x400
-#define LDAP_DEBUG_PARSE 0x800
-/* More values for http gateway */
-#define LDAP_DEBUG_GWAY 0x1000
-#define LDAP_DEBUG_GWAYMORE 0x2000
-
-#define LDAP_DEBUG_ANY 0xffff
-
-#ifdef LDAP_SYSLOG
-/* ldaplog is a general logging function that is defined in liblber/i18n.c */
-#define Debug(level, fmt, arg1, arg2, arg3) \
- { \
- if (ldap_debug & level) \
- fprintf(stderr, fmt, arg1, arg2, arg3); \
- if (ldap_syslog & level) \
- ldaplog(level, fmt, arg1, arg2, arg3); \
- }
-#else /* LDAP_SYSLOG */
-#ifndef WINSOCK
-#define Debug(level, fmt, arg1, arg2, arg3) \
- if (ldap_debug & level) \
- fprintf(stderr, fmt, arg1, arg2, arg3);
-#else /* !WINSOCK */
-extern void Debug(int level, char *fmt, ...);
-#endif /* !WINSOCK */
-#endif /* LDAP_SYSLOG */
-#else /* LDAP_DEBUG */
-#define Debug(level, fmt, arg1, arg2, arg3)
-#endif /* LDAP_DEBUG */
-
-
-#ifndef NEEDPROTOS
-extern LDAP *ldap_open();
-#ifdef LDAP_SSL
-extern LDAP *ldap_ssl_open();
-#endif /* LDAP_SSL */
-extern LDAP *ldap_init();
-#ifdef STR_TRANSLATION
-extern void ldap_set_string_translators();
-#ifdef LDAP_CHARSET_8859
-extern int ldap_t61_to_8859();
-extern int ldap_8859_to_t61();
-#endif /* LDAP_CHARSET_8859 */
-#endif /* STR_TRANSLATION */
-extern LDAPMessage *ldap_first_entry();
-extern LDAPMessage *ldap_next_entry();
-extern char *ldap_get_dn();
-extern char *ldap_dn2ufn();
-extern char **ldap_explode_dn();
-extern char *ldap_first_attribute();
-extern char *ldap_next_attribute();
-extern char **ldap_get_values();
-extern struct berval **ldap_get_values_len();
-extern void ldap_value_free();
-extern void ldap_value_free_len();
-extern int ldap_count_values();
-extern int ldap_count_values_len();
-extern char *ldap_err2string();
-extern void ldap_getfilter_free();
-extern LDAPFiltDesc *ldap_init_getfilter();
-extern LDAPFiltDesc *ldap_init_getfilter_buf();
-extern LDAPFiltInfo *ldap_getfirstfilter();
-extern LDAPFiltInfo *ldap_getnextfilter();
-extern void ldap_setfilteraffixes();
-extern void ldap_build_filter();
-extern void ldap_flush_cache();
-extern void ldap_set_cache_options();
-extern void ldap_uncache_entry();
-extern void ldap_uncache_request();
-extern char *ldap_friendly_name();
-extern void ldap_free_friendlymap();
-extern LDAP *cldap_open();
-extern void cldap_setretryinfo();
-extern void cldap_close();
-extern LDAPFiltDesc *ldap_ufn_setfilter();
-extern int ldap_ufn_timeout();
-extern int ldap_sort_entries();
-extern int ldap_sort_values();
-extern int ldap_sort_strcasecmp();
-void ldap_free_urldesc();
-void ldap_free_urlexts();
-void ldap_set_rebind_proc();
-void ldap_enable_translation();
-/* Begin Display Template Prototypes */
-typedef int (*writeptype)();
-
-int ldap_init_templates();
-int ldap_init_templates_buf();
-void ldap_free_templates();
-struct ldap_disptmpl *ldap_first_disptmpl();
-struct ldap_disptmpl *ldap_next_disptmpl();
-struct ldap_disptmpl *ldap_name2template();
-struct ldap_disptmpl *ldap_oc2template();
-char **ldap_tmplattrs();
-struct ldap_tmplitem *ldap_first_tmplrow();
-struct ldap_tmplitem *ldap_next_tmplrow();
-struct ldap_tmplitem *ldap_first_tmplcol();
-struct ldap_tmplitem *ldap_next_tmplcol();
-int ldap_entry2text_search();
-int ldap_entry2text();
-int ldap_vals2text();
-int ldap_entry2html_search();
-int ldap_entry2html();
-int ldap_vals2html();
-
-int ldap_init_searchprefs();
-int ldap_init_searchprefs_buf();
-void ldap_free_searchprefs();
-struct ldap_searchobj *ldap_first_searchobj();
-struct ldap_searchobj *ldap_next_searchobj();
-
-#else /* NEEDPROTOS */
-#if !defined(MACOS) && !defined(DOS) && !defined(_WIN32) && !defined(WINSOCK)
-#include <sys/time.h>
-#endif
-
-
-/*
- * Abandon functions
- */
-int ldap_abandon_ext(LDAP *ld, int msgid, LDAPControl **serverctrls,
- LDAPControl ** clientctrls);
-int ldap_abandon(LDAP *ld, int msgid);
-
-/*
- * Add functions
- */
-int ldap_add_ext(LDAP *ld, char *dn, LDAPMod **attrs,
- LDAPControl ** serverctrls, LDAPControl **clientctrls, int *msgidp);
-int ldap_add_ext_s(LDAP *ld, char *dn, LDAPMod **attrs,
- LDAPControl ** serverctrls, LDAPControl **clientctrls);
-int ldap_add(LDAP *ld, char *dn, LDAPMod **attrs);
-int ldap_add_s(LDAP *ld, char *dn, LDAPMod **attrs);
-
-/*
- * Bind functions
- */
-/* DEPRECATED */
-int ldap_bind(LDAP *ld, char *who, char *passwd, int authmethod);
-/* DEPRECATED */
-int ldap_bind_s(LDAP *ld, char *who, char *cred, int method);
-#ifdef LDAP_REFERRALS
-/* DEPRECATED */
-void ldap_set_rebind_proc(LDAP *ld, LDAP_REBIND_FUNCTION *rebindproc,
- void *extra_arg);
-#endif /* LDAP_REFERRALS */
-
-/*
- * Simple bind functions
- */
-int ldap_simple_bind(LDAP *ld, char *who, char *passwd);
-int ldap_simple_bind_s(LDAP *ld, char *who, char *passwd);
-
-/*
- * SASL functions
- */
-int ldap_sasl_bind(LDAP *ld, char *dn, char *mechanism, struct berval *cred,
- LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp);
-int ldap_sasl_bind_s(LDAP *ld, char *dn, char *mechanism, struct berval *cred,
- LDAPControl **serverctrls, LDAPControl **clientctrls,
- struct berval **servercredp);
-
-/*
- * Kerberos functions
- */
-/* DEPRECATED */
-int ldap_kerberos_bind_s(LDAP *ld, char *who);
-/* DEPRECATED */
-int ldap_kerberos_bind1(LDAP *ld, char *who);
-/* DEPRECATED */
-int ldap_kerberos_bind1_s(LDAP *ld, char *who);
-/* DEPRECATED */
-int ldap_kerberos_bind2(LDAP *ld, char *who);
-/* DEPRECATED */
-int ldap_kerberos_bind2_s(LDAP *ld, char *who);
-
-#ifndef NO_CACHE
-/*
- * Cache functions
- */
-int ldap_enable_cache(LDAP *ld, time_t timeout, ssize_t maxmem);
-void ldap_disable_cache(LDAP *ld);
-void ldap_set_cache_options(LDAP *ld, unsigned int opts);
-void ldap_destroy_cache(LDAP *ld);
-void ldap_flush_cache(LDAP *ld);
-void ldap_uncache_entry(LDAP *ld, char *dn);
-void ldap_uncache_request(LDAP *ld, int msgid);
-#endif /* !NO_CACHE */
-
-/*
- * Compare functions
- */
-int ldap_compare_ext(LDAP *ld, char *dn, char *attr, struct berval *bvalue,
- LDAPControl ** serverctrls, LDAPControl **clientctrls, int *msgidp);
-int ldap_compare_ext_s(LDAP *ld, char *dn, char *attr, struct berval *bvalue,
- LDAPControl ** serverctrls, LDAPControl **clientctrls);
-int ldap_compare(LDAP *ld, char *dn, char *attr, char *value);
-int ldap_compare_s(LDAP *ld, char *dn, char *attr, char *value);
-
-/*
- * Delete functions
- */
-int ldap_delete_ext(LDAP *ld, char *dn, LDAPControl **serverctrls,
- LDAPControl **clientctrls, int *msgidp);
-int ldap_delete_ext_s(LDAP *ld, char *dn, LDAPControl **serverctrls,
- LDAPControl **clientctrls);
-int ldap_delete(LDAP *ld, char *dn);
-int ldap_delete_s(LDAP *ld, char *dn);
-
-/*
- * Error functions
- */
-char *ldap_err2string(int err);
-
-/* DEPRECATED */
-int ldap_result2error(LDAP *ld, LDAPMessage *r, int freeit);
-/* DEPRECATED */
-void ldap_perror(LDAP *ld, char *s);
-
-/*
- * Modify functions
- */
-int ldap_modify_ext(LDAP *ld, char *dn, LDAPMod **mods,
- LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp);
-int ldap_modify_ext_s(LDAP *ld, char *dn, LDAPMod **mods,
- LDAPControl **serverctrls, LDAPControl **clientctrls);
-int ldap_modify(LDAP *ld, char *dn, LDAPMod **mods);
-int ldap_modify_s(LDAP *ld, char *dn, LDAPMod **mods);
-
-/*
- * Modrdn functions
- */
-
-/* DEPRECATED : use ldap_rename instead */
-int ldap_modrdn0(LDAP *ld, char *dn, char *newrdn);
-/* DEPRECATED : use ldap_rename_s instead */
-int ldap_modrdn0_s(LDAP *ld, char *dn, char *newrdn);
-/* DEPRECATED : use ldap_rename instead */
-int ldap_modrdn(LDAP *ld, char *dn, char *newrdn,
- int deleteoldrdn);
-/* DEPRECATED : use ldap_rename_s instead */
-int ldap_modrdn_s(LDAP *ld, char *dn, char *newrdn,
- int deleteoldrdn);
-
-/*
- * Rename functions
- */
-int ldap_rename(LDAP *ld, char *dn, char *newrdn, char *newparent,
- int deleteoldrdn, LDAPControl ** serverctrls,
- LDAPControl **clientctrls, int *msgidp);
-int ldap_rename_s(LDAP *ld, char *dn, char *newrdn, char *newparent,
- int deleteoldrdn, LDAPControl ** serverctrls,
- LDAPControl **clientctrls);
-
-/*
- * Init/Open functions
- */
-LDAP *ldap_init(char *defhost, int defport);
-
-/* DEPRECATED : use ldap_init instead */
-LDAP *ldap_open(char *host, int port);
-
-#ifdef LDAP_SSL
-LDAP *ldap_ssl_init(char *defhost, int defport, char *keyname);
-
-/* DEPRECATED : use ldap_ssl_init instead */
-LDAP *ldap_ssl_open(char *host, int port, char *keyname);
-#endif
-
-/*
- * Entry functions
- */
-LDAPMessage *ldap_first_entry(LDAP *ld, LDAPMessage *res);
-LDAPMessage *ldap_next_entry(LDAP *ld, LDAPMessage *entry);
-int ldap_count_entries(LDAP *ld, LDAPMessage *res);
-
-/*
- * Message functions
- */
-LDAPMessage *ldap_first_message(LDAP *ld, LDAPMessage *res);
-LDAPMessage *ldap_next_message(LDAP *ld, LDAPMessage *msg);
-int ldap_count_messages(LDAP *ld, LDAPMessage *res);
-
-/*
- * Reference functions
- */
-LDAPMessage *ldap_first_reference(LDAP *ld, LDAPMessage *res);
-LDAPMessage *ldap_next_reference(LDAP *ld, LDAPMessage *msg);
-int ldap_count_references(LDAP *ld, LDAPMessage *res);
-char ** ldap_get_reference_urls(LDAP *ld, LDAPMessage *res);
-
-/*
- * Entry functions
- */
-LDAPMessage *ldap_delete_result_entry(LDAPMessage **list,
- LDAPMessage *e);
-void ldap_add_result_entry(LDAPMessage **list, LDAPMessage *e);
-
-/*
- * DN functions
- */
-char *ldap_get_dn(LDAP *ld, LDAPMessage *entry);
-char **ldap_explode_dn(char *dn, int notypes);
-char ** ldap_explode_rdn(char *rdn, int notypes);
-char *ldap_dn2ufn(char *dn);
-
-char **ldap_explode_dns(char *dn);
-int ldap_is_dns_dn(char *dn);
-char *ldap_dns_to_dn(char *dns_name, int *nameparts);
-
-/*
- * Attribute parsing functions
- */
-char *ldap_first_attribute(LDAP *ld, LDAPMessage *entry,
- BerElement **ber);
-char *ldap_next_attribute(LDAP *ld, LDAPMessage *entry,
- BerElement *ber);
-void ldap_memfree(char *mem);
-
-/*
- * Attribute Value functions
- */
-char **ldap_get_values(LDAP *ld, LDAPMessage *entry, char *target);
-struct berval **ldap_get_values_len(LDAP *ld, LDAPMessage *entry,
- char *target);
-int ldap_count_values(char **vals);
-int ldap_count_values_len(struct berval **vals);
-void ldap_value_free(char **vals);
-void ldap_value_free_len(struct berval **vals);
-
-/*
- * Result functions
- */
-int ldap_result(LDAP *ld, int msgid, int all,
- struct timeval *timeout, LDAPMessage **result);
-int ldap_msgdelete(LDAP *ld, int msgid);
-int ldap_msgfree(LDAPMessage *lm);
-int ldap_msgtype(LDAPMessage *res);
-int ldap_msgid(LDAPMessage *res);
-int ldap_parse_result(LDAP *ld, LDAPMessage *res, int *errcodep,
- char **matcheddnp, char **errmsgp, char ***referralsp,
- LDAPControl ***serverctrlsp, int freeit);
-int ldap_parse_sasl_bind_result(LDAP *ld, LDAPMessage *res,
- struct berval **servercredp, int freeit);
-int ldap_parse_extended_result(LDAP *ld, LDAPMessage *res,
- char **resultoidp, struct berval **resultdata, int freeit);
-int cldap_getmsg(LDAP *ld, struct timeval *timeout, BerElement *ber);
-
-
-/*
- * Search functions
- */
-int ldap_search_ext(LDAP *ld, char *base, int scope, char *filter,
- char **attrs, int attrsonly, LDAPControl **serverctrls,
- LDAPControl **clientctrls, struct timeval *timeoutp,
- int sizelimit, int *msgidp);
-int ldap_search_ext_s(LDAP *ld, char *base, int scope, char *filter,
- char **attrs, int attrsonly, LDAPControl **serverctrls,
- LDAPControl **clientctrls, struct timeval *timeoutp, int sizelimit,
- LDAPMessage **res);
-
-int ldap_search(LDAP *ld, char *base, int scope, char *filter,
- char **attrs, int attrsonly);
-int ldap_search_s(LDAP *ld, char *base, int scope, char *filter,
- char **attrs, int attrsonly, LDAPMessage **res);
-int ldap_search_st(LDAP *ld, char *base, int scope, char *filter,
- char **attrs, int attrsonly, struct timeval *timeout, LDAPMessage **res);
-
-/*
- * UFN functions
- */
-int ldap_ufn_search_c(LDAP *ld, char *ufn, char **attrs,
- int attrsonly, LDAPMessage **res, int (*cancelproc)(void *cl),
- void *cancelparm);
-int ldap_ufn_search_ct(LDAP *ld, char *ufn, char **attrs,
- int attrsonly, LDAPMessage **res, int (*cancelproc)(void *cl),
- void *cancelparm, char *tag1, char *tag2, char *tag3);
-int ldap_ufn_search_s(LDAP *ld, char *ufn, char **attrs,
- int attrsonly, LDAPMessage **res);
-LDAPFiltDesc *ldap_ufn_setfilter(LDAP *ld, char *fname);
-void ldap_ufn_setprefix(LDAP *ld, char *prefix);
-int ldap_ufn_timeout(void *tvparam);
-
-
-/*
- * Unbind functions
- */
-int ldap_unbind(LDAP *ld);
-int ldap_unbind_s(LDAP *ld);
-
-
-/*
- * Filter functions
- */
-LDAPFiltDesc *ldap_init_getfilter(char *fname);
-LDAPFiltDesc *ldap_init_getfilter_buf(char *buf, ssize_t buflen);
-LDAPFiltInfo *ldap_getfirstfilter(LDAPFiltDesc *lfdp, char *tagpat,
- char *value);
-LDAPFiltInfo *ldap_getnextfilter(LDAPFiltDesc *lfdp);
-void ldap_setfilteraffixes(LDAPFiltDesc *lfdp, char *prefix, char *suffix);
-void ldap_build_filter(char *buf, size_t buflen,
- char *pattern, char *prefix, char *suffix, char *attr,
- char *value, char **valwords);
-
-/*
- * Functions to free LDAPFiltDesc and LDAPmod
- */
-void ldap_getfilter_free(LDAPFiltDesc *lfdp);
-void ldap_mods_free(LDAPMod **mods, int freemods);
-
-/*
- * Friendly name functions
- */
-char *ldap_friendly_name(char *filename, char *uname,
- FriendlyMap **map);
-void ldap_free_friendlymap(FriendlyMap **map);
-
-
-/*
- * Connectionless LDAP functions
- */
-LDAP *cldap_open(char *host, int port);
-void cldap_close(LDAP *ld);
-int cldap_search_s(LDAP *ld, char *base, int scope, char *filter,
- char **attrs, int attrsonly, LDAPMessage **res, char *logdn);
-void cldap_setretryinfo(LDAP *ld, int tries, time_t timeout);
-
-
-/*
- * Sort functions
- */
-int ldap_sort_entries(LDAP *ld, LDAPMessage **chain, char *attr,
- int (*cmp)());
-int ldap_sort_values(LDAP *ld, char **vals, int (*cmp)());
-int ldap_sort_strcasecmp(char **a, char **b);
-
-
-/*
- * URL functions
- */
-int ldap_is_ldap_url(char *url);
-int ldap_url_parse(char *url, LDAPURLDesc **ludpp);
-void ldap_free_urlexts(LDAPURLExt **lues);
-void ldap_free_urldesc(LDAPURLDesc *ludp);
-int ldap_url_search(LDAP *ld, char *url, int attrsonly);
-int ldap_url_search_s(LDAP *ld, char *url, int attrsonly,
- LDAPMessage **res);
-int ldap_url_search_st(LDAP *ld, char *url, int attrsonly,
- struct timeval *timeout, LDAPMessage **res);
-char *ldap_dns_to_url(LDAP *ld, char *dns_name, char *attrs,
-char *scope, char *filter);
-char *ldap_dn_to_url(LDAP *ld, char *dn, int nameparts);
-
-
-/*
- * in Character Set functions
- */
-#ifdef STR_TRANSLATION
-void ldap_set_string_translators(LDAP *ld,
- BERTranslateProc encode_proc, BERTranslateProc decode_proc);
-int ldap_translate_from_t61(LDAP *ld, char **bufp,
- unsigned int *lenp, int free_input);
-int ldap_translate_to_t61(LDAP *ld, char **bufp,
- unsigned int *lenp, int free_input);
-void ldap_enable_translation(LDAP *ld, LDAPMessage *entry,
- int enable);
-
-#ifdef LDAP_CHARSET_8859
-int ldap_t61_to_8859(char **bufp, unsigned int *buflenp,
- int free_input);
-int ldap_8859_to_t61(char **bufp, unsigned int *buflenp,
- int free_input);
-#endif /* LDAP_CHARSET_8859 */
-#endif /* STR_TRANSLATION */
-
-/*
- * Diplay Template functions
- */
-typedef int (*writeptype)(void *writeparm, char *p, int len);
-
-int ldap_init_templates(char *file,
- struct ldap_disptmpl **tmpllistp);
-
-int ldap_init_templates_buf(char *buf, ssize_t buflen,
- struct ldap_disptmpl **tmpllistp);
-
-void ldap_free_templates(struct ldap_disptmpl *tmpllist);
-
-struct ldap_disptmpl *ldap_first_disptmpl(
- struct ldap_disptmpl *tmpllist);
-
-struct ldap_disptmpl *ldap_next_disptmpl(
- struct ldap_disptmpl *tmpllist, struct ldap_disptmpl *tmpl);
-
-struct ldap_disptmpl *ldap_name2template(char *name,
- struct ldap_disptmpl *tmpllist);
-
-struct ldap_disptmpl *ldap_oc2template(char **oclist,
- struct ldap_disptmpl *tmpllist);
-
-char **ldap_tmplattrs(struct ldap_disptmpl *tmpl,
- char **includeattrs, int exclude, unsigned int syntaxmask);
-
-struct ldap_tmplitem *ldap_first_tmplrow(struct ldap_disptmpl *tmpl);
-
-struct ldap_tmplitem *ldap_next_tmplrow(struct ldap_disptmpl *tmpl,
- struct ldap_tmplitem *row);
-
-struct ldap_tmplitem *ldap_first_tmplcol(struct ldap_disptmpl *tmpl,
- struct ldap_tmplitem *row);
-
-struct ldap_tmplitem *ldap_next_tmplcol(struct ldap_disptmpl *tmpl,
- struct ldap_tmplitem *row, struct ldap_tmplitem *col);
-
-int ldap_entry2text(LDAP *ld, char *buf, LDAPMessage *entry,
- struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals,
- writeptype writeproc, void *writeparm, char *eol,
- int rdncount, unsigned int opts);
-
-int ldap_vals2text(LDAP *ld, char *buf, char **vals, char *label,
- int labelwidth, unsigned int syntaxid, writeptype writeproc,
- void *writeparm, char *eol, int rdncount);
-
-int ldap_entry2text_search(LDAP *ld, char *dn, char *base,
- LDAPMessage *entry, struct ldap_disptmpl *tmpllist,
- char **defattrs, char ***defvals, writeptype writeproc,
- void *writeparm, char *eol, int rdncount, unsigned int opts);
-
-int ldap_entry2html(LDAP *ld, char *buf, LDAPMessage *entry,
- struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals,
- writeptype writeproc, void *writeparm, char *eol,
- int rdncount, unsigned int opts, char *urlprefix, char *base);
-
-int ldap_vals2html(LDAP *ld, char *buf, char **vals, char *label,
- int labelwidth, unsigned int syntaxid, writeptype writeproc,
- void *writeparm, char *eol, int rdncount, char *urlprefix);
-
-int ldap_entry2html_search(LDAP *ld, char *dn, char *base,
- LDAPMessage *entry, struct ldap_disptmpl *tmpllist,
- char **defattrs, char ***defvals, writeptype writeproc,
- void *writeparm, char *eol, int rdncount, unsigned int opts,
- char *urlprefix);
-
-
-/*
- * Search Preferences functions
- */
-int ldap_init_searchprefs(char *file,
- struct ldap_searchobj **solistp);
-
-int ldap_init_searchprefs_buf(char *buf, ssize_t buflen,
- struct ldap_searchobj **solistp);
-
-void ldap_free_searchprefs(struct ldap_searchobj *solist);
-
-struct ldap_searchobj *ldap_first_searchobj(
- struct ldap_searchobj *solist);
-
-struct ldap_searchobj *ldap_next_searchobj(
- struct ldap_searchobj *sollist, struct ldap_searchobj *so);
-
-
-/*
- * Option functions
- */
-int ldap_get_option(LDAP *ld, int option, void *outvalue);
-int ldap_set_option(LDAP *ld, int option, void *invalue);
-
-
-/*
- * Control functions
- */
-void ldap_control_free(LDAPControl *ctrl);
-void ldap_controls_free(LDAPControl **ctrls);
-
-
-/*
- * Simple Page Control functions
- */
-int ldap_create_page_control(LDAP *ld, unsigned int pagesize,
- struct berval *cookie, char isCritical, LDAPControl **output);
-int ldap_parse_page_control(LDAP *ld, LDAPControl **controls,
- unsigned int *totalcount, struct berval **cookie);
-
-/*
- * Server Side Sort control functions
- */
-int ldap_create_sort_control(LDAP *ld, LDAPsortkey **sortKeyList,
- const char ctl_iscritical, LDAPControl **ctrlp);
-int ldap_parse_sort_control(LDAP *ld, LDAPControl **ctrlp,
- unsigned long *result, char **attribute);
-int ldap_create_sort_keylist(LDAPsortkey ***sortKeyList, char *string_rep);
-void ldap_free_sort_keylist(LDAPsortkey **sortKeyList);
-
-/*
- * Virtual List View control functions
- */
-int ldap_create_virtuallist_control(LDAP *ld, LDAPVirtualList *ldvlistp,
- LDAPControl **ctrlp);
-int ldap_parse_virtuallist_control(LDAP *ld, LDAPControl **ctrls,
- unsigned long *target_posp, unsigned long *list_sizep,
- int *errcodep);
-
-#endif /* NEEDPROTOS */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _LDAP_H */
diff --git a/usr/src/lib/libldap4/include/ldapconfig.h b/usr/src/lib/libldap4/include/ldapconfig.h
deleted file mode 100644
index c197c3c33c..0000000000
--- a/usr/src/lib/libldap4/include/ldapconfig.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- *
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- * File chamged to fit with Sun Standards
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/*
- * Copyright (c) 1994 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
-#ifndef _CONFIG_H
-#define _CONFIG_H
-
-/*
- * config.h for LDAP -- edit this file to customize LDAP client behavior.
- * NO platform-specific definitions should be placed in this file.
- * Note that this is NOT used by the LDAP or LBER libraries.
- */
-
-/*
- * SHARED DEFINITIONS - things you should change
- */
- /* default ldap host */
-#define LDAPHOST "localhost"
- /* default place to start searching */
-#define DEFAULT_BASE "c=US"
-
-/*********************************************************************
- * *
- * You probably do not need to edit anything below this point *
- * *
- *********************************************************************/
-
-/*
- * SHARED DEFINITIONS - other things you can change
- */
- /* default attribute to use when sorting entries, NULL => sort by DN */
-#define SORT_ATTR NULL
- /* default count of DN components to show in entry displays */
-#define DEFAULT_RDNCOUNT 2
- /* default config file locations */
-#define FILTERFILE "/etc/opt/SUNWconn/ldap/current/ldapfilter.conf"
-#define TEMPLATEFILE "/etc/opt/SUNWconn/ldap/current/ldaptemplates.conf"
-#define SEARCHFILE "/etc/opt/SUNWconn/ldap/current/ldapsearchprefs.conf"
-#define FRIENDLYFILE "/etc/opt/SUNWconn/ldap/current/ldapfriendly"
-
-/*
- * FINGER DEFINITIONS
- */
- /* who to bind as */
-#define FINGER_BINDDN NULL
- /* where to search */
-#define FINGER_BASE DEFAULT_BASE
- /* banner to print */
-#define FINGER_BANNER "X.500 Finger Service...\r\n"
- /* who to report errors to */
-#define FINGER_ERRORS "your local system administrator"
- /* what to say if no matches are found */
-#define FINGER_NOMATCH "Search failed to find anything.\r\n"
- /* what to say if the service may be unavailable */
-#define FINGER_UNAVAILABLE \
-"The X.500 service may be temporarily unavailable.\r\n\
-Please try again later.\r\n"
- /* printed if a match has no email address - for disptmp default */
-#define FINGER_NOEMAIL1 "None registered in this service."
-#define FINGER_NOEMAIL2 NULL
-#define FINGER_NOEMAIL { FINGER_NOEMAIL1, FINGER_NOEMAIL2, NULL }
- /* maximum number of matches returned */
-#define FINGER_SIZELIMIT 50
- /* max number of hits displayed in full before a list is presented */
-#define FINGER_LISTLIMIT 1
- /* what to exec for "finger @host" */
-#define FINGER_CMD "/usr/ucb/finger"
- /* how to treat aliases when searching */
-#define FINGER_DEREF LDAP_DEREF_FINDING
- /* attribute to use when sorting results */
-#define FINGER_SORT_ATTR SORT_ATTR
- /* enable ufn support */
-#define FINGER_UFN
- /* timeout for searches */
-#define FINGER_TIMEOUT 60
- /* number of DN components to show in entry displays */
-#define FINGER_RDNCOUNT DEFAULT_RDNCOUNT
-
-/*
- * GO500 GOPHER GATEWAY DEFINITIONS
- */
- /* who to bind as */
-#define GO500_BINDDN NULL
- /* where to search */
-#define GO500_BASE DEFAULT_BASE
- /* port on which to listen */
-#define GO500_PORT 5555
- /* how to handle aliases */
-#define GO500_DEREF LDAP_DEREF_FINDING
- /* attribute to use when sorting results */
-#define GO500_SORT_ATTR SORT_ATTR
- /* timeout for searches */
-#define GO500_TIMEOUT 180
- /* enable ufn support */
-#define GO500_UFN
- /*
- * only set and uncomment this if your hostname() does not return
- * a fully qualified hostname
- */
-/* #define GO500_HOSTNAME "fully.qualified.hostname.here" */
- /* number of DN components to show in entry displays */
-#define GO500_RDNCOUNT DEFAULT_RDNCOUNT
-
-/*
- * GO500GW GOPHER GATEWAY DEFINITIONS
- */
- /* who to bind as */
-#define GO500GW_BINDDN NULL
- /* where the helpfile lives */
-#define GO500GW_HELPFILE "go500gw.help"
- /* port on which to listen */
-#define GO500GW_PORT 7777
- /* timeout on all searches */
-#define GO500GW_TIMEOUT 180
- /* enable ufn support */
-#define GO500GW_UFN
- /* attribute to use when sorting results */
-#define GO500GW_SORT_ATTR SORT_ATTR
- /*
- * only set and uncomment this if your hostname() does not return
- * a fully qualified hostname
- */
-/* #define GO500GW_HOSTNAME "fully.qualified.hostname.here" */
- /* number of DN components to show in entry displays */
-#define GO500GW_RDNCOUNT DEFAULT_RDNCOUNT
-
-/*
- * RCPT500 MAIL RESPONDER GATEWAY DEFINITIONS
- */
- /* who to bind as */
-#define RCPT500_BINDDN NULL
- /* where the helpfile lives */
-#define RCPT500_HELPFILE "rcpt500.help"
- /* maximum number of matches returned */
-#define RCPT500_SIZELIMIT 50
- /* address replies will appear to come from */
-#define RCPT500_FROM "\"X.500 Query Program\" <X500-Query>"
- /* command that will accept an RFC822 message text on standard
- input, and send it. sendmail -t does this nicely. */
-#define RCPT500_PIPEMAILCMD "/usr/lib/sendmail -t"
- /* where to search */
-#define RCPT500_BASE DEFAULT_BASE
- /* attribute to use when sorting results */
-#define RCPT500_SORT_ATTR SORT_ATTR
- /* max number of hits displayed in full before a list is presented */
-#define RCPT500_LISTLIMIT 1
- /* enable ufn support */
-#define RCPT500_UFN
- /* number of DN components to show in entry displays */
-#define RCPT500_RDNCOUNT DEFAULT_RDNCOUNT
-
-/*
- * LDAPSEARCH TOOL
- */
- /* who to bind as */
-#define LDAPSEARCH_BINDDN NULL
- /* search base */
-#define LDAPSEARCH_BASE DEFAULT_BASE
-
-/*
- * LDAPMODIFY TOOL
- */
- /* who to bind as */
-#define LDAPMODIFY_BINDDN NULL
- /* search base */
-#define LDAPMODIFY_BASE DEFAULT_BASE
-
-/*
- * LDAPDELETE TOOL
- */
- /* who to bind as */
-#define LDAPDELETE_BINDDN NULL
- /* search base */
-#define LDAPDELETE_BASE DEFAULT_BASE
-
-/*
- * LDAPMODRDN TOOL
- */
- /* who to bind as */
-#define LDAPMODRDN_BINDDN NULL
- /* search base */
-#define LDAPMODRDN_BASE DEFAULT_BASE
-
-/*
- * MAIL500 MAILER DEFINITIONS
- */
- /* who to bind as */
-#define MAIL500_BINDDN NULL
- /* max number of ambiguous matches reported */
-#define MAIL500_MAXAMBIGUOUS 10
- /* max subscribers allowed (size limit when searching for them ) */
-#define MAIL500_MAXGROUPMEMBERS LDAP_NO_LIMIT
- /* timeout for all searches */
-#define MAIL500_TIMEOUT 180
- /* sendmail location - mail500 needs to exec this */
-#define MAIL500_SENDMAIL "/usr/lib/sendmail"
-
-/*
- * UD DEFINITIONS
- */
- /* ud configuration file */
-#define UD_CONFIG_FILE "/etc/opt/SUNWconn/ldap/current/ud.conf"
- /* default editor */
-#define UD_DEFAULT_EDITOR "/usr/ucb/vi"
- /* default bbasename of user config file */
-#define UD_USER_CONFIG_FILE ".udrc"
- /* default user to bind as */
-#define UD_BINDDN NULL
- /* default password to bind with */
-#define UD_PASSWD NULL
- /* default search base */
-#define UD_BASE DEFAULT_BASE
- /* default base where groups are created */
-#define UD_WHERE_GROUPS_ARE_CREATED ""
- /* default base below which all groups live */
-#define UD_WHERE_ALL_GROUPS_LIVE ""
-
-/*
- * FAX500 DEFINITIONS
- */
- /* what to bind as */
-#define FAX_BINDDN NULL
- /* how long to wait for searches */
-#define FAX_TIMEOUT 180
- /* maximum number of ambiguous matches reported */
-#define FAX_MAXAMBIGUOUS 10
- /* maximum number of members allowed */
-#define FAX_MAXMEMBERS LDAP_NO_LIMIT
- /* program to send mail */
-#define FAX_SENDMAIL "/usr/lib/sendmail"
-
-/*
- * RP500 DEFINITIONS
- */
- /* what to bind as */
-#define RP_BINDDN NULL
- /* prefix to add to non-fully-qualified numbers */
-#define RP_PHONEPREFIX ""
-
-/*
- * SLAPD DEFINITIONS
- */
- /* location of the default slapd config file */
-#define SLAPD_DEFAULT_CONFIGFILE "/etc/opt/SUNWconn/ldap/current/slapd.conf"
- /* default sizelimit on number of entries from a search */
-#define SLAPD_DEFAULT_SIZELIMIT 10000
- /* default timelimit to spend on a search */
-#define SLAPD_DEFAULT_TIMELIMIT 3600
- /* location of the slapd pid file */
-#define SLAPD_PIDFILE "/var/opt/SUNWconn/ldap/log/slapd.pid"
- /* location of the slapd args file */
-#define SLAPD_ARGSFILE "/var/opt/SUNWconn/ldap/log/slapd.args"
- /* dn of the special "monitor" entry */
-#define SLAPD_MONITOR_DN "cn=monitor"
- /* dn of the special "config" entry */
-#define SLAPD_CONFIG_DN "cn=config"
- /* minimum max ids that a single index entry can map to in ldbm */
-#define SLAPD_LDBM_MIN_MAXIDS 4000
-
-#endif /* _CONFIG_H */
diff --git a/usr/src/lib/libldap4/include/ldif.h b/usr/src/lib/libldap4/include/ldif.h
deleted file mode 100644
index 4eddf63095..0000000000
--- a/usr/src/lib/libldap4/include/ldif.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/*
- * Copyright (c) 1996 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
-#ifndef _LDIF_H
-#define _LDIF_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define LINE_WIDTH 76 /* maximum length of LDIF lines */
-
-/*
- * Macro to calculate maximum number of bytes that the base64 equivalent
- * of an item that is "vlen" bytes long will take up. Base64 encoding
- * uses one byte for every six bits in the value plus up to two pad bytes.
- */
-#define LDIF_BASE64_LEN(vlen) (((vlen) * 4 / 3 ) + 3)
-
-/*
- * Macro to calculate maximum size that an LDIF-encoded type (length
- * tlen) and value (length vlen) will take up: room for type + ":: " +
- * first newline + base64 value + continued lines. Each continued line
- * needs room for a newline and a leading space character.
- */
-#define LDIF_SIZE_NEEDED(tlen,vlen) \
- ((tlen) + 4 + LDIF_BASE64_LEN(vlen) \
- + ((LDIF_BASE64_LEN(vlen) + tlen + 3) / LINE_WIDTH * 2 ))
-
-
-#ifdef NEEDPROTOS
-int str_parse_line( char *line, char **type, char **value, int *vlen);
-char * str_getline( char **next );
-void put_type_and_value( char **out, char *t, char *val, int vlen );
-char *ldif_type_and_value( char *type, char *val, int vlen );
-#else /* NEEDPROTOS */
-int str_parse_line();
-char * str_getline();
-void put_type_and_value();
-char *ldif_type_and_value();
-#endif /* NEEDPROTOS */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _LDIF_H */
diff --git a/usr/src/lib/libldap4/include/log.h b/usr/src/lib/libldap4/include/log.h
deleted file mode 100644
index 038f0564e3..0000000000
--- a/usr/src/lib/libldap4/include/log.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifndef _LLOG_H
-#define _LLOG_H
-
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <nl_types.h>
-#include <limits.h>
-#include <syslog.h>
-#include <portable.h>
-
-
-
-/* Log levels */
-
-/* slapd values */
-#define LDAP_DEBUG_TRACE 0x001
-#define LDAP_DEBUG_PACKETS 0x002
-#define LDAP_DEBUG_ARGS 0x004
-#define LDAP_DEBUG_CONNS 0x008
-#define LDAP_DEBUG_BER 0x010
-#define LDAP_DEBUG_FILTER 0x020
-#define LDAP_DEBUG_CONFIG 0x040
-#define LDAP_DEBUG_ACL 0x080
-#define LDAP_DEBUG_STATS 0x100
-#define LDAP_DEBUG_STATS2 0x200
-#define LDAP_DEBUG_SHELL 0x400
-#define LDAP_DEBUG_PARSE 0x800
-/* More values for http gateway */
-#define LDAP_DEBUG_GWAY 0x1000
-#define LDAP_DEBUG_GWAYMORE 0x2000
-/* Generic values */
-#define LDAP_DEBUG_ANY 0xffff
-
-nl_catd sundscat;
-extern nl_catd slapdcat;
-extern void ldaplogconfig(char * logf, int size);
-extern void ldaplogconfigf(FILE *fd);
-extern void ldaploginit(char *name,
- int facility);
-extern void ldaploginitlevel(char *name,
- int facility,
- int log_level);
-extern void ldaplog(int level,char *fmt,...);
-
-#define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \
-{ \
- if ( log_debug & level ) \
- fprintf( stderr, fmt, connid, opid, arg1, arg2, arg3 );\
- if ( log_syslog & level ) \
- ldaplog( level, fmt, connid, opid, arg1, arg2, arg3 ); \
-}
-#endif /* _LLOG_H */
-
-
-
diff --git a/usr/src/lib/libldap4/include/lthread.h b/usr/src/lib/libldap4/include/lthread.h
deleted file mode 100644
index cbafb7fec8..0000000000
--- a/usr/src/lib/libldap4/include/lthread.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- *
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/* lthread.h - ldap threads header file */
-
-#ifndef _LTHREAD_H
-#define _LTHREAD_H
-
-#if defined( THREAD_SUNOS4_LWP )
-/***********************************
- * *
- * thread definitions for sunos4 *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <lwp/lwp.h>
-#include <lwp/stackdep.h>
-
-typedef void *(*VFP)();
-
-/* thread attributes and thread type */
-typedef int pthread_attr_t;
-typedef thread_t pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default NULL
-#define pthread_condattr_default NULL
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED 1
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_SCOPE_SYSTEM 1
-
-/* mutex attributes and mutex type */
-typedef int pthread_mutexattr_t;
-typedef mon_t pthread_mutex_t;
-
-/* condition variable attributes and condition variable type */
-typedef int pthread_condattr_t;
-typedef struct lwpcv {
- int lcv_created;
- cv_t lcv_cv;
-} pthread_cond_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE 0
-#define PTHREAD_SHARE_PROCESS 1
-
-#else /* end sunos4 */
-
-#if defined( THREAD_SUNOS5_LWP )
-/***********************************
- * *
- * thread definitions for sunos5 *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <thread.h>
-#include <synch.h>
-
-typedef void *(*VFP)();
-
-/* sunos5 threads are preemptive */
-#define PTHREAD_PREEMPTIVE 1
-
-#ifndef _PTHREAD_H
-
-/* thread attributes and thread type */
-typedef int pthread_attr_t;
-typedef thread_t pthread_t;
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED THR_DETACHED
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_SCOPE_SYSTEM THR_BOUND
-
-/* mutex attributes and mutex type */
-typedef int pthread_mutexattr_t;
-typedef mutex_t pthread_mutex_t;
-
-/* condition variable attributes and condition variable type */
-typedef int pthread_condattr_t;
-typedef cond_t pthread_cond_t;
-
-#endif /* _PTHREAD_H */
-
-/* default attr states */
-#define pthread_mutexattr_default NULL
-#define pthread_condattr_default NULL
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE USYNC_THREAD
-#define PTHREAD_SHARE_PROCESS USYNC_PROCESS
-
-#else /* end sunos5 */
-
-#if defined( THREAD_MIT_PTHREADS )
-/***********************************
- * *
- * definitions for mit pthreads *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <pthread.h>
-
-#else /* end mit pthreads */
-
-#if defined( THREAD_DCE_PTHREADS )
-/***********************************
- * *
- * definitions for dce pthreads *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <pthread.h>
-
-/* dce threads are preemptive */
-#define PTHREAD_PREEMPTIVE 1
-
-#define pthread_attr_init( a ) pthread_attr_create( a )
-#define pthread_attr_destroy( a ) pthread_attr_delete( a )
-#define pthread_attr_setdetachstate( a, b ) \
- pthread_attr_setdetach_np( a, b )
-
-#endif /* dce pthreads */
-#endif /* mit pthreads */
-#endif /* sunos5 */
-#endif /* sunos4 */
-
-#ifndef _THREAD
-
-/***********************************
- * *
- * thread definitions for no *
- * underlying library support *
- * *
- ***********************************/
-
-typedef void *(*VFP)();
-
-/* thread attributes and thread type */
-typedef int pthread_attr_t;
-typedef int pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default NULL
-#define pthread_condattr_default NULL
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED 0
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_SCOPE_SYSTEM 0
-
-/* mutex attributes and mutex type */
-typedef int pthread_mutexattr_t;
-typedef int pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE 0
-#define PTHREAD_SHARE_PROCESS 0
-
-/* condition variable attributes and condition variable type */
-typedef int pthread_condattr_t;
-typedef int pthread_cond_t;
-
-#endif /* no threads support */
-#endif /* _LTHREAD_H */
diff --git a/usr/src/lib/libldap4/include/portable.h b/usr/src/lib/libldap4/include/portable.h
deleted file mode 100644
index 5405fa8765..0000000000
--- a/usr/src/lib/libldap4/include/portable.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- *
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/*
- * Copyright (c) 1994 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
-#ifndef _PORTABLE_H
-#define _PORTABLE_H
-
-/*
- * portable.h for LDAP -- this is where we define common stuff to make
- * life easier on various Unix systems.
- *
- * Unless you are porting LDAP to a new platform, you should not need to
- * edit this file.
- */
-
-
-#ifndef SYSV
-#if defined( hpux ) || defined( sunos5 ) || defined ( sgi ) || defined( SVR4 )
-#define SYSV
-#endif
-#endif
-
-
-/*
- * under System V, use sysconf() instead of getdtablesize
- */
-#if !defined( USE_SYSCONF ) && defined( SYSV )
-#define USE_SYSCONF
-#endif
-
-
-/*
- * under System V, daemons should use setsid() instead of detaching from their
- * tty themselves
- */
-#if !defined( USE_SETSID ) && defined( SYSV )
-#define USE_SETSID
-#endif
-
-
-/*
- * System V has socket options in filio.h
- */
-#if !defined( NEED_FILIO ) && defined( SYSV ) && !defined( hpux )
-#define NEED_FILIO
-#endif
-
-/*
- * use lockf() under System V
- */
-#if !defined( USE_LOCKF ) && ( defined( SYSV ) || defined( aix ))
-#define USE_LOCKF
-#endif
-
-/*
- * on many systems, we should use waitpid() instead of waitN()
- */
-#if !defined( USE_WAITPID ) && ( defined( SYSV ) || defined( sunos4 ) || defined( ultrix ) || defined( aix ))
-#define USE_WAITPID
-#endif
-
-
-/*
- * define the wait status argument type
- */
-#if ( defined( SunOS ) && SunOS < 40 ) || defined( nextstep )
-#define WAITSTATUSTYPE union wait
-#else
-#define WAITSTATUSTYPE int
-#endif
-
-/*
- * define the flags for wait
- */
-#ifdef sunos5
-#define WAIT_FLAGS ( WNOHANG | WUNTRACED | WCONTINUED )
-#else
-#define WAIT_FLAGS ( WNOHANG | WUNTRACED )
-#endif
-
-
-/*
- * defined the options for openlog (syslog)
- */
-#ifdef ultrix
-#define OPENLOG_OPTIONS LOG_PID
-#else
-#define OPENLOG_OPTIONS ( LOG_PID | LOG_NOWAIT )
-#endif
-
-
-/*
- * some systems don't have the BSD re_comp and re_exec routines
- */
-#ifndef NEED_BSDREGEX
-#if defined( SYSV ) || defined( VMS ) || defined( netbsd ) || defined( freebsd ) || defined( linux )
-#define NEED_BSDREGEX
-#endif
-#endif
-
-/*
- * many systems do not have the setpwfile() library routine... we just
- * enable use for those systems we know have it.
- */
-#ifndef HAVE_SETPWFILE
-#if defined( sunos4 ) || defined( ultrix ) || defined( __osf__ )
-#define HAVE_SETPWFILE
-#endif
-#endif
-
-/*
- * Are sys_errlist and sys_nerr declared in stdio.h?
- */
-#ifndef SYSERRLIST_IN_STDIO
-#if defined( freebsd )
-#define SYSERRLIST_IN_STDIO
-#endif
-#endif
-
-/*
- * for select()
- */
-#if !defined(FD_SET) && !defined(WINSOCK)
-#define NFDBITS 32
-#define FD_SETSIZE 32
-#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
-#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
-#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
-#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
-#endif /* FD_SET */
-
-#if defined( hpux ) && defined( __STDC__ )
-/*
- * Under HP/UX, select seems to want (int *) instead of fd_set. Non-ANSI
- * compilers don't like recursive macros, so ignore the problem if __STDC__
- * is not defined.
- */
-#define select(a,b,c,d,e) select(a, (int *)b, (int *)c, (int *)d, e)
-#endif /* hpux && __STDC__ */
-
-
-/*
- * for signal() -- what do signal handling functions return?
- */
-#ifndef SIG_FN
-#ifdef sunos5
-# define SIG_FN void /* signal-catching functions return void */
-#else /* sunos5 */
-# ifdef BSD
-# if (BSD >= 199006) || defined(NeXT) || defined(__osf__) || defined(sun) || defined(ultrix) || defined(apollo) || defined(POSIX_SIGNALS)
-# define SIG_FN void /* signal-catching functions return void */
-# else
-# define SIG_FN int /* signal-catching functions return int */
-# endif
-# else /* BSD */
-# define SIG_FN void /* signal-catching functions return void */
-# endif /* BSD */
-#endif /* sunos5 */
-#endif /* SIG_FN */
-
-/*
- * call signal or sigset (signal does not block the signal while
- * in the handler on sys v and sigset does not exist on bsd)
- */
-#ifdef SYSV
-#define SIGNAL sigset
-#else
-#define SIGNAL signal
-#endif
-
-/*
- * toupper and tolower macros are different under bsd and sys v
- */
-#if defined( SYSV ) && !defined( hpux )
-#define TOUPPER(c) (isascii(c) && islower(c) ? _toupper(c) : c)
-#define TOLOWER(c) (isascii(c) && isupper(c) ? _tolower(c) : c)
-#else
-#define TOUPPER(c) (isascii(c) && islower(c) ? toupper(c) : c)
-#define TOLOWER(c) (isascii(c) && isupper(c) ? tolower(c) : c)
-#endif
-
-/*
- * put a cover on the tty-related ioctl calls we need to use
- */
-#if defined( NeXT ) || (defined(SunOS) && SunOS < 40)
-#define TERMIO_TYPE struct sgttyb
-#define TERMFLAG_TYPE int
-#define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop))
-#define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop))
-#define GETFLAGS( tio ) (tio).sg_flags
-#define SETFLAGS( tio, flags ) (tio).sg_flags = (flags)
-#else
-#define USE_TERMIOS
-#define TERMIO_TYPE struct termios
-#define TERMFLAG_TYPE tcflag_t
-#define GETATTR( fd, tiop ) tcgetattr((fd), (tiop))
-#define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop))
-#define GETFLAGS( tio ) (tio).c_lflag
-#define SETFLAGS( tio, flags ) (tio).c_lflag = (flags)
-#endif
-
-
-#if defined( ultrix ) || defined( nextstep )
-extern char *strdup();
-#endif /* ultrix || nextstep */
-
-#endif /* _PORTABLE_H */
diff --git a/usr/src/lib/libldap4/include/regex.h b/usr/src/lib/libldap4/include/regex.h
deleted file mode 100644
index 175a851878..0000000000
--- a/usr/src/lib/libldap4/include/regex.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#if defined( MACOS ) || defined( DOS ) || defined( _WIN32 ) || defined( NEED_BSDREGEX )
-/*
- * Copyright (c) 1993 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-/*
- * regex.h -- includes for regular expression matching routines
- * 13 August 1993 Mark C Smith
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined( NEEDPROTOS ) && defined( __STDC__ )
-#define NEEDPROTOS
-#endif
-
-#ifdef NEEDPROTOS
-char *re_comp( char *pat );
-int re_exec( char *lp );
-void re_modw( char *s );
-int re_subs( char *src, char *dst );
-#else /* NEEDPROTOS */
-char *re_comp();
-int re_exec();
-void re_modw();
-int re_subs();
-#endif /* NEEDPROTOS */
-
-#define re_fail( m, p )
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* MACOS or DOS or NEED_BSDREGEX */
diff --git a/usr/src/lib/libldap4/include/sec.h b/usr/src/lib/libldap4/include/sec.h
deleted file mode 100644
index 11d94760cc..0000000000
--- a/usr/src/lib/libldap4/include/sec.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *
- * Copyright 1999 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- *
- * Comments:
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifndef _SEC_H_
-#define _SEC_H_
-
-#include <sys/types.h>
-#include <md5.h>
-
-void hmac_md5(unsigned char *text, int text_len, unsigned char *key,
- int key_len, unsigned char *digest);
-
-char *hexa_print(unsigned char *aString, int aLen);
-char *hexa2str(char *anHexaStr, int *aResLen);
-
-#endif /* _SEC_H_ */
diff --git a/usr/src/lib/libldap4/include/ssl.h b/usr/src/lib/libldap4/include/ssl.h
deleted file mode 100644
index bd0c860a3a..0000000000
--- a/usr/src/lib/libldap4/include/ssl.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- *
- * This is a dummy header file for SSL
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifndef _SSL_H
-#define _SSL_H
-
-#include <sys/types.h>
-
-typedef void * SSL;
-
-SSL SSL_new();
-int SSL_connect(SSL s, int filedes);
-int SSL_accept(SSL s, int filedes);
-int SSL_read(SSL s, u_char *buf, u_int len);
-int SSL_write(SSL s, u_char *buf, u_int len);
-int SSL_fread(SSL s, u_char *buf, u_int len);
-int SSL_fwrite(SSL s, u_char *buf, u_int len);
-int SSL_flush(SSL s);
-int SSL_close(SSL s);
-int SSL_delete(SSL s);
-char **SSL_get_supported_ciphers();
-int SSL_get_cipher(SSL s, char **cipher);
-int SSL_set_cipher(SSL s, char **cipher);
-int SSL_set_verification(SSL s, char **root_ca_list, int *certificate_type_list);
-int SSL_set_userid(SSL s, char *name, char *id);
-int SSL_save_session(SSL s, u_char **id, int *len);
-int SSL_set_session(SSL s, u_char *id, int len);
-int SSL_delete_session(u_char *id, int len);
-int SSL_errno(SSL s);
-char *SSL_strerr(int err);
-int SSL_get_fd(SSL s);
-
-#endif _SSL_H
diff --git a/usr/src/lib/libldap4/include/sysexits-compat.h b/usr/src/lib/libldap4/include/sysexits-compat.h
deleted file mode 100644
index 0e5e37e3d7..0000000000
--- a/usr/src/lib/libldap4/include/sysexits-compat.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/*
- * Copyright (c) 1987 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)sysexits.h 4.5 (Berkeley) 7/6/88
- */
-
-/*
-** SYSEXITS.H -- Exit status codes for system programs.
-**
-** This include file attempts to categorize possible error
-** exit statuses for system programs, notably delivermail
-** and the Berkeley network.
-**
-** Error numbers begin at EX__BASE to reduce the possibility of
-** clashing with other exit statuses that random programs may
-** already return. The meaning of the codes is approximately
-** as follows:
-**
-** EX_USAGE -- The command was used incorrectly, e.g., with
-** the wrong number of arguments, a bad flag, a bad
-** syntax in a parameter, or whatever.
-** EX_DATAERR -- The input data was incorrect in some way.
-** This should only be used for user's data & not
-** system files.
-** EX_NOINPUT -- An input file (not a system file) did not
-** exist or was not readable. This could also include
-** errors like "No message" to a mailer (if it cared
-** to catch it).
-** EX_NOUSER -- The user specified did not exist. This might
-** be used for mail addresses or remote logins.
-** EX_NOHOST -- The host specified did not exist. This is used
-** in mail addresses or network requests.
-** EX_UNAVAILABLE -- A service is unavailable. This can occur
-** if a support program or file does not exist. This
-** can also be used as a catchall message when something
-** you wanted to do doesn't work, but you don't know
-** why.
-** EX_SOFTWARE -- An internal software error has been detected.
-** This should be limited to non-operating system related
-** errors as possible.
-** EX_OSERR -- An operating system error has been detected.
-** This is intended to be used for such things as "cannot
-** fork", "cannot create pipe", or the like. It includes
-** things like getuid returning a user that does not
-** exist in the passwd file.
-** EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
-** etc.) does not exist, cannot be opened, or has some
-** sort of error (e.g., syntax error).
-** EX_CANTCREAT -- A (user specified) output file cannot be
-** created.
-** EX_IOERR -- An error occurred while doing I/O on some file.
-** EX_TEMPFAIL -- temporary failure, indicating something that
-** is not really an error. In sendmail, this means
-** that a mailer (e.g.) could not create a connection,
-** and the request should be reattempted later.
-** EX_PROTOCOL -- the remote system returned something that
-** was "not possible" during a protocol exchange.
-** EX_NOPERM -- You did not have sufficient permission to
-** perform the operation. This is not intended for
-** file system problems, which should use NOINPUT or
-** CANTCREAT, but rather for higher level permissions.
-** For example, kre uses this to restrict who students
-** can send mail to.
-**
-** Maintained by Eric Allman (eric@berkeley, ucbvax!eric) --
-** please mail changes to me.
-**
-** @(#)sysexits.h 4.5 7/6/88
-*/
-
-# define EX_OK 0 /* successful termination */
-
-# define EX__BASE 64 /* base value for error messages */
-
-# define EX_USAGE 64 /* command line usage error */
-# define EX_DATAERR 65 /* data format error */
-# define EX_NOINPUT 66 /* cannot open input */
-# define EX_NOUSER 67 /* addressee unknown */
-# define EX_NOHOST 68 /* host name unknown */
-# define EX_UNAVAILABLE 69 /* service unavailable */
-# define EX_SOFTWARE 70 /* internal software error */
-# define EX_OSERR 71 /* system error (e.g., can't fork) */
-# define EX_OSFILE 72 /* critical OS file missing */
-# define EX_CANTCREAT 73 /* can't create (user) output file */
-# define EX_IOERR 74 /* input/output error */
-# define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
-# define EX_PROTOCOL 76 /* remote error in protocol */
-# define EX_NOPERM 77 /* permission denied */
-# define EX_CONFIG 78 /* configuration error */
diff --git a/usr/src/lib/libldap4/include/thq.h b/usr/src/lib/libldap4/include/thq.h
deleted file mode 100644
index d503a8a3c8..0000000000
--- a/usr/src/lib/libldap4/include/thq.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *
- * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <pthread.h>
-
-typedef void * (*PFP)(void *);
-
-typedef void * (*PFP2)(void *, void *);
-
-typedef struct tq_listS {
- void * arg;
- struct tq_listS * next;
-} tq_listT, * tq_listTp;
-
-typedef struct {
- tq_listTp first; /* first element in the queue */
- tq_listTp last; /* last element in the queue */
- pthread_mutex_t lock; /* queue mutex */
- pthread_cond_t cond; /* queue condition to signal new elements */
- int * shutdown; /* variable to test to see shutdown condition*/
- int shutalloc; /* is the shutdown variable allocated locally*/
- int stopping; /* queue is currently stopping */
- int queue_size; /* current size of the queue */
- int nb_thr; /* current nb of threads pocessing the queue */
- int thr_waiting; /* current nb of threads waiting */
- int max_thr; /* max allowed threads to process the queue */
- int min_thr; /* min nb of threads to keep alive */
- PFP doit; /* function to call to process the queue */
- PFP2 endit; /* function called before to end the thread */
- void * arg; /* argument to pass to the doit/endit func. */
- pthread_t * tids; /* array of thread ids for watchdog */
-} tqT, * tqTp;
-
-extern tqTp tq_alloc(PFP process_func, /* function to process the queue */
- PFP2 shutdown_func, /* function called before to end */
- void * func_arg, /* arg passed to both functions */
- int * shutdown, /* shutdown variable to test */
- int max, /* max allowed threads */
- int min); /* min allowed threads */
-
-extern int tq_queue(tqTp queue, /* pointer to the queue */
- void * arg); /* element to be queued */
-
-/* tq_dequeue returns the first "arg" passed to tq_queue */
-extern void * tq_dequeue(tqTp queue, /* pointer to the queue */
- void * endit_arg); /* pointer to "shutdown" arguments */
-/*
- * tq_end_thread terminates the current
- * thread and restarts a new one if necessary
- */
-extern void tq_end_thread (tqTp queue, /* pointer to the queue */
- void * endit_arg); /* pointer to "shutdown" arguments */
-
-/*
- * tq_shutdown, shutdown the queue (alternate way to shutdown if you don't
- * have a global shutdown integer
- *
- * shutdown can be immediate (1) or delayed until there is nothing more
- * in the queue (immadiate = 0)
- *
- * when you call this function, no more argument can be queued using
- * tq_queue.
- *
- * when tq_dequeue returns, the queue pointer is not allocated anymore
- *
- */
-extern void tq_shutdown(tqTp queue, /* pointer to the queue */
- int immediate); /* 1: don't wait, 0: wait for queue */
- /* to be empty */