]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/back-meta.h
Do not return pointers into BerElement we do not own
[openldap] / servers / slapd / back-meta / back-meta.h
index 0c99d1e4f5a8372b1de3cecc77406cb0827fbb04..bcd1e9990e7770445f1b3f889c59cf3e2662d6cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2001 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  *
  * Copyright 1999, Howard Chu, All rights reserved. <hyc@highlandsun.com>
@@ -77,7 +77,7 @@
 
 /* String rewrite library */
 #include "rewrite.h"
-
+#include "cache.h"
 LDAP_BEGIN_DECL
 
 struct slap_conn;
@@ -87,15 +87,19 @@ struct metasingleconn {
        int                     candidate;
 #define        META_NOT_CANDIDATE      0
 #define        META_CANDIDATE          1
+#define        META_LAST_CONN          -1
        
        LDAP                    *ld;
-       struct berval           *bound_dn;
+       struct berval           bound_dn;
+       struct berval           cred;
        int                     bound;
 #define META_UNBOUND           0
 #define META_BOUND             1
 #define META_ANONYMOUS         2
 };
 
+#define META_LAST(lsc)         ((lsc)->candidate == META_LAST_CONN)
+
 struct metaconn {
        struct slap_conn        *conn;
        struct rewrite_info     *rwinfo;
@@ -108,18 +112,18 @@ struct metaconn {
 #define META_BOUND_NONE                -1
 #define META_BOUND_ALL         -2
        /* supersedes the connection stuff */
-       struct metasingleconn **conns;
+       struct metasingleconn *conns;
 };
 
 struct metatarget {
        char                    *uri;
-       struct berval           *psuffix;       /* pretty suffix */
-       struct berval           *suffix;        /* normalized suffix */
-       struct berval           *binddn;
-       struct berval           *bindpw;
+       struct berval           psuffix;        /* pretty suffix */
+       struct berval           suffix;         /* normalized suffix */
+       struct berval           binddn;
+       struct berval           bindpw;
 
-       struct berval           *pseudorootdn;
-       struct berval           *pseudorootpw;
+       struct berval           pseudorootdn;
+       struct berval           pseudorootpw;
 
        struct rewrite_info     *rwinfo;
 
@@ -142,23 +146,19 @@ struct metainfo {
 #define META_DEFAULT_TARGET_NONE       -1
        struct metatarget       **targets;
 
+#ifdef LDAP_CACHING 
+       struct rewrite_info     *rwinfo;
+       cache_manager           *cm; 
+       Backend                 *glue_be; 
+#endif /* LDAP_CACHING */
+
        struct metadncache      cache;
        
        ldap_pvt_thread_mutex_t conn_mutex;
        Avlnode                 *conntree;
-};
-
-extern int
-meta_back_do_single_bind(
-               struct metainfo         *li,
-               struct metaconn         *lc,
-               struct berval           *dn,
-               struct berval           *ndn,
-               struct berval           *cred,
-               int                     method,
-               int                     candidate
-);
 
+       int                     savecred;
+};
 
 #define META_OP_ALLOW_MULTIPLE         0x00
 #define META_OP_REQUIRE_SINGLE         0x01