More header work toward draft-ietf-ldapext-ldap-c-api-01.

This commit is contained in:
Kurt Zeilenga 1998-10-26 01:49:56 +00:00
parent 702109706b
commit 43f29c3cb8
18 changed files with 81 additions and 23 deletions

View file

@ -30,6 +30,12 @@
#include "lber.h" #include "lber.h"
#include "ldap.h" #include "ldap.h"
#if LDAP_VERSION < LDAP_VERSION3
/* quick fix until we have ldap_set_options */
#include "../libraries/libldap/ldap-int.h"
#endif
#include <ldapconfig.h> #include <ldapconfig.h>
#define USER 0 #define USER 0

View file

@ -26,6 +26,11 @@
#include <lber.h> #include <lber.h>
#include <ldap.h> #include <ldap.h>
#if LDAP_VERSION < LDAP_VERSION3
/* quick fix until we have ldap_set_options */
#include "../libraries/libldap/ldap-int.h"
#endif
#include <ldapconfig.h> #include <ldapconfig.h>
#define DEFAULT_PORT 79 #define DEFAULT_PORT 79

View file

@ -27,6 +27,12 @@
#include "lber.h" #include "lber.h"
#include "ldap.h" #include "ldap.h"
#if LDAP_VERSION < LDAP_VERSION3
/* quick fix until we have ldap_set_options */
#include "../libraries/libldap/ldap-int.h"
#endif
#include "disptmpl.h" #include "disptmpl.h"
#include "ldapconfig.h" #include "ldapconfig.h"

View file

@ -32,6 +32,12 @@
#include "ldapconfig.h" #include "ldapconfig.h"
#include "lber.h" #include "lber.h"
#include "ldap.h" #include "ldap.h"
#if LDAP_VERSION < LDAP_VERSION3
/* quick fix until we have ldap_set_options */
#include "../libraries/libldap/ldap-int.h"
#endif
#include "disptmpl.h" #include "disptmpl.h"
int debug; int debug;

View file

@ -31,6 +31,12 @@
#include "lber.h" #include "lber.h"
#include "ldap.h" #include "ldap.h"
#if LDAP_VERSION < LDAP_VERSION3
/* quick fix until we have ldap_set_options */
#include "../libraries/libldap/ldap-int.h"
#endif
#include "disptmpl.h" #include "disptmpl.h"
#include "ldapconfig.h" #include "ldapconfig.h"

View file

@ -30,6 +30,12 @@
#include "lber.h" #include "lber.h"
#include "ldap.h" #include "ldap.h"
#if LDAP_VERSION < LDAP_VERSION3
/* quick fix until we have ldap_set_options */
#include "../libraries/libldap/ldap-int.h"
#endif
#include "ldapconfig.h" #include "ldapconfig.h"
#define USER 0x01 #define USER 0x01

View file

@ -17,6 +17,12 @@
#include "lber.h" #include "lber.h"
#include "ldap.h" #include "ldap.h"
#if LDAP_VERSION < LDAP_VERSION3
/* quick fix until we have ldap_set_options */
#include "../libraries/libldap/ldap-int.h"
#endif
#include "disptmpl.h" #include "disptmpl.h"
#include "rcpt500.h" #include "rcpt500.h"

View file

@ -35,6 +35,7 @@
#include <lber.h> #include <lber.h>
#include <ldap.h> #include <ldap.h>
#include <ldapconfig.h> #include <ldapconfig.h>
#include "ud.h" #include "ud.h"

View file

@ -12,6 +12,11 @@
#include "portable.h" #include "portable.h"
#if LDAP_VERSION < LDAP_VERSION3
/* quick fix until we have ldap_set_options */
#include "../libraries/libldap/ldap-int.h"
#endif
#ifdef DOS #ifdef DOS
#define MAX_VALUES 8 #define MAX_VALUES 8
#else #else

View file

@ -83,6 +83,9 @@ typedef struct berelement BerElement;
typedef struct sockbuf Sockbuf; typedef struct sockbuf Sockbuf;
#define READBUFSIZ 8192 #define READBUFSIZ 8192
typedef struct seqorset Seqorset;
#define NULLSEQORSET ((Seqorset *) 0)
/* structure for returning a sequence of octet strings + length */ /* structure for returning a sequence of octet strings + length */
struct berval { struct berval {
unsigned long bv_len; unsigned long bv_len;

View file

@ -54,8 +54,7 @@ LDAP_BEGIN_DECL
#define LDAP_OPT_SUCCESS 0 #define LDAP_OPT_SUCCESS 0
#define LDAP_OPT_ERROR (-1) #define LDAP_OPT_ERROR (-1)
LDAP_F int ldap_get_option LDAP_P((LDAP *ld, int option, void *outvalue)); extern int ldap_debug;
LDAP_F int ldap_set_option LDAP_P((LDAP *ld, int option, void *invalue));
typedef struct ldapapiinfo { typedef struct ldapapiinfo {
int ldapai_info_version; /* version of LDAPAPIInfo (1) */ int ldapai_info_version; /* version of LDAPAPIInfo (1) */
@ -72,10 +71,6 @@ typedef struct ldapcontrol {
char ldctl_iscritical; char ldctl_iscritical;
} LDAPControl, *PLDAPControl; } LDAPControl, *PLDAPControl;
LDAP_F void ldap_control_free LDAP_P(( LDAPControl *ctrl ));
LDAP_F void ldap_controls_free LDAP_P(( LDAPControl **ctrls ));
#define LDAP_MAX_ATTR_LEN 100 #define LDAP_MAX_ATTR_LEN 100
/* /*
@ -457,6 +452,12 @@ typedef struct ldap_url_desc {
in function param list warning */ in function param list warning */
typedef struct timeval LDAPtv; typedef struct timeval LDAPtv;
LDAP_F int ldap_get_option LDAP_P((LDAP *ld, int option, void *outvalue));
LDAP_F int ldap_set_option LDAP_P((LDAP *ld, int option, void *invalue));
LDAP_F void ldap_control_free LDAP_P(( LDAPControl *ctrl ));
LDAP_F void ldap_controls_free LDAP_P(( LDAPControl **ctrls ));
/* /*
* in abandon.c: * in abandon.c:
*/ */

View file

@ -63,4 +63,4 @@ extern void Debug( int level, char* fmt, ... );
LDAP_END_DECL LDAP_END_DECL
#endif /* _LDAP_H */ #endif /* _LDAP_LOG_H */

View file

@ -17,7 +17,7 @@
LDAP_BEGIN_DECL LDAP_BEGIN_DECL
typedef struct berelement { struct berelement {
char *ber_buf; char *ber_buf;
char *ber_ptr; char *ber_ptr;
char *ber_end; char *ber_end;
@ -32,10 +32,10 @@ typedef struct berelement {
char *ber_rwptr; char *ber_rwptr;
BERTranslateProc ber_encode_translate_proc; BERTranslateProc ber_encode_translate_proc;
BERTranslateProc ber_decode_translate_proc; BERTranslateProc ber_decode_translate_proc;
} BerElement; };
#define NULLBER ((BerElement *) 0) #define NULLBER ((BerElement *) 0)
typedef struct sockbuf { struct sockbuf {
#ifndef MACOS #ifndef MACOS
int sb_sd; int sb_sd;
#else /* MACOS */ #else /* MACOS */
@ -56,17 +56,17 @@ typedef struct sockbuf {
#define LBER_NO_READ_AHEAD 0x08 /* read only as much as requested */ #define LBER_NO_READ_AHEAD 0x08 /* read only as much as requested */
int sb_fd; int sb_fd;
long sb_max_incoming; long sb_max_incoming;
} Sockbuf; };
#define READBUFSIZ 8192 #define READBUFSIZ 8192
typedef struct seqorset { struct seqorset {
BerElement *sos_ber; BerElement *sos_ber;
unsigned long sos_clen; unsigned long sos_clen;
unsigned long sos_tag; unsigned long sos_tag;
char *sos_first; char *sos_first;
char *sos_ptr; char *sos_ptr;
struct seqorset *sos_next; struct seqorset *sos_next;
} Seqorset; };
#define NULLSEQORSET ((Seqorset *) 0) #define NULLSEQORSET ((Seqorset *) 0)
#endif /* _LBER_INT_H */ #endif /* _LBER_INT_H */

View file

@ -5,6 +5,8 @@
* ldap-int.h - defines & prototypes internal to the LDAP library * ldap-int.h - defines & prototypes internal to the LDAP library
*/ */
#ifndef _LDAP_INT_H
#define _LDAP_INT_H 1
#include "../liblber/lber-int.h" #include "../liblber/lber-int.h"
#include "ldap_log.h" #include "ldap_log.h"
@ -34,20 +36,20 @@ LDAP_BEGIN_DECL
* where a response has multiple messages. * where a response has multiple messages.
*/ */
typedef struct ldapmsg { struct ldapmsg {
int lm_msgid; /* the message id */ int lm_msgid; /* the message id */
int lm_msgtype; /* the message type */ int lm_msgtype; /* the message type */
BerElement *lm_ber; /* the ber encoded message contents */ BerElement *lm_ber; /* the ber encoded message contents */
struct ldapmsg *lm_chain; /* for search - next msg in the resp */ struct ldapmsg *lm_chain; /* for search - next msg in the resp */
struct ldapmsg *lm_next; /* next response */ struct ldapmsg *lm_next; /* next response */
unsigned int lm_time; /* used to maintain cache */ unsigned int lm_time; /* used to maintain cache */
} LDAPMessage; };
/* /*
* structure representing an ldap connection * structure representing an ldap connection
*/ */
typedef struct ldap { struct ldap {
Sockbuf ld_sb; /* socket descriptor & buffer */ Sockbuf ld_sb; /* socket descriptor & buffer */
char *ld_host; char *ld_host;
int ld_version; int ld_version;
@ -95,7 +97,7 @@ typedef struct ldap {
char **passwdp, int *authmethodp, int freeit ); char **passwdp, int *authmethodp, int freeit );
/* routine to get info needed for re-bind */ /* routine to get info needed for re-bind */
#endif /* LDAP_REFERRALS */ #endif /* LDAP_REFERRALS */
} LDAP; };
/* /*
* in cache.c * in cache.c
@ -210,3 +212,5 @@ int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input );
LDAP_END_DECL LDAP_END_DECL
#endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */ #endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */
#endif /* _LDAP_INT_H */

View file

@ -20,9 +20,6 @@
#include <fcntl.h> #include <fcntl.h>
#include "lber.h"
#include "ldap.h"
/* including the "internal" defs is legit and nec. since this test routine has /* including the "internal" defs is legit and nec. since this test routine has
* a-priori knowledge of libldap internal workings. * a-priori knowledge of libldap internal workings.
* hodges@stanford.edu 5-Feb-96 * hodges@stanford.edu 5-Feb-96

View file

@ -8,9 +8,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/ctype.h> #include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h> #include <ac/time.h>
#ifdef HAVE_SYS_FILE_H #ifdef HAVE_SYS_FILE_H
@ -18,7 +17,8 @@
#endif #endif
#include "lber.h" #include "lber.h"
#include "ldap.h" #include "ldap-int.h"
#include "ldap_log.h"
#include "disptmpl.h" #include "disptmpl.h"
#include "ldapconfig.h" #include "ldapconfig.h"

View file

@ -17,6 +17,10 @@
#include "avl.h" #include "avl.h"
#include "lber.h" #include "lber.h"
#include "ldap.h" #include "ldap.h"
#include "ldap_log.h"
#include "../libraries/libldap/ldap-int.h"
#include "lthread.h" #include "lthread.h"
#include "lthread_rdwr.h" #include "lthread_rdwr.h"
#include "ldif.h" #include "ldif.h"

View file

@ -26,6 +26,8 @@
#include "lber.h" #include "lber.h"
#include "ldap.h" #include "ldap.h"
#include "ldap_log.h"
#include "../libraries/libldap/ldap-int.h"
#include "lthread.h" #include "lthread.h"
#include "ldapconfig.h" #include "ldapconfig.h"
#include "ldif.h" #include "ldif.h"