]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slap.h
- setup framework for monitoring of back-bdb/back-hdb stuff in their
[openldap] / servers / slapd / slap.h
index adfb0167467a764812fdcec7f5af7e594784b2b7..0fcbcb62914b5fd9e226a4603c3c857b2727a3bf 100644 (file)
@@ -67,10 +67,13 @@ LDAP_BEGIN_DECL
 #define LDAP_COLLECTIVE_ATTRIBUTES
 #define LDAP_COMP_MATCH
 #define LDAP_SYNC_TIMESTAMP
+#define SLAP_SORTEDRESULTS
 #endif
 
+#define SLAP_RELAX
 #define LDAP_DYNAMIC_OBJECTS
 #define SLAP_CONTROL_X_TREE_DELETE LDAP_CONTROL_X_TREE_DELETE
+#define SLAP_DISTPROC
 
 #ifdef ENABLE_REWRITE
 #define SLAP_AUTH_REWRITE      1 /* use librewrite for sasl-regexp */
@@ -1099,6 +1102,8 @@ typedef struct slap_attr {
        unsigned a_flags;
 #define SLAP_ATTR_IXADD                0x1U
 #define SLAP_ATTR_IXDEL                0x2U
+#define SLAP_ATTR_DONT_FREE_DATA       0x4U
+#define SLAP_ATTR_DONT_FREE_VALS       0x8U
 } Attribute;
 
 
@@ -1131,6 +1136,7 @@ typedef struct slap_entry {
        slap_mask_t     e_ocflags;
 
        struct berval   e_bv;           /* For entry_encode/entry_decode */
+       struct berval   *e_abv;
 
        /* for use by the backend for any purpose */
        void*   e_private;
@@ -1448,23 +1454,18 @@ typedef enum {
 } slap_acl_state_t;
 
 typedef struct slap_acl_state {
-       slap_acl_state_t as_recorded;
-
        /* Access state */
-       AccessControl *as_vd_acl;
        AccessControl *as_vi_acl;
-       slap_mask_t as_vd_acl_mask;
-       regmatch_t as_vd_acl_matches[MAXREMATCHES];
-       int as_vd_acl_count;
+       AccessControl *as_vd_acl;
+       AttributeDescription *as_vd_ad;
 
-       Access *as_vd_access;
-       int as_vd_access_count;
 
+       slap_acl_state_t as_recorded;
+       int as_vd_acl_count;
        int as_result;
-       AttributeDescription *as_vd_ad;
 } AccessControlState;
-#define ACL_STATE_INIT { ACL_STATE_NOT_RECORDED, NULL, NULL, 0UL, \
-       { { 0, 0 } }, 0, NULL, 0, 0, NULL }
+#define ACL_STATE_INIT { NULL, NULL, NULL, \
+       ACL_STATE_NOT_RECORDED, 0, 0 }
 
 /*
  * Backend-info
@@ -1698,6 +1699,7 @@ struct slap_backend_db {
 /* Database flags */
 #define SLAP_DBFLAG_NOLASTMOD          0x0001U
 #define SLAP_DBFLAG_NO_SCHEMA_CHECK    0x0002U
+#define        SLAP_DBFLAG_HIDDEN              0x0004U
 #define        SLAP_DBFLAG_GLUE_INSTANCE       0x0010U /* a glue backend */
 #define        SLAP_DBFLAG_GLUE_SUBORDINATE    0x0020U /* child of a glue hierarchy */
 #define        SLAP_DBFLAG_GLUE_LINKED         0x0040U /* child is connected to parent */
@@ -1713,6 +1715,7 @@ struct slap_backend_db {
 #define SLAP_DBFLAGS(be)                       ((be)->be_flags)
 #define SLAP_NOLASTMOD(be)                     (SLAP_DBFLAGS(be) & SLAP_DBFLAG_NOLASTMOD)
 #define SLAP_LASTMOD(be)                       (!SLAP_NOLASTMOD(be))
+#define SLAP_DBHIDDEN(be)                      (SLAP_DBFLAGS(be) & SLAP_DBFLAG_HIDDEN)
 #define SLAP_ISOVERLAY(be)                     (SLAP_DBFLAGS(be) & SLAP_DBFLAG_OVERLAY)
 #define SLAP_ISGLOBALOVERLAY(be)               (SLAP_DBFLAGS(be) & SLAP_DBFLAG_GLOBAL_OVERLAY)
 #define SLAP_NO_SCHEMA_CHECK(be)       \
@@ -2295,7 +2298,6 @@ struct slap_control_ids {
        int sc_assert;
        int sc_domainScope;
        int sc_dontUseCopy;
-       int sc_manageDIT;
        int sc_manageDSAit;
        int sc_modifyIncrement;
        int sc_noOp;
@@ -2304,8 +2306,9 @@ struct slap_control_ids {
        int sc_postRead;
        int sc_preRead;
        int sc_proxyAuthz;
+       int sc_relax;
        int sc_searchOptions;
-#ifdef LDAP_DEVEL
+#ifdef SLAP_SORTEDRESULTS
        int sc_sortedResults;
 #endif
        int sc_subentries;
@@ -2442,6 +2445,8 @@ typedef struct slap_op {
        char o_delete_glue_parent;
        char o_no_schema_check;
 #define get_no_schema_check(op)                        ((op)->o_no_schema_check)
+       char o_no_subordinate_glue;
+#define get_no_subordinate_glue(op)            ((op)->o_no_subordinate_glue)
 
 #define SLAP_CONTROL_NONE      0
 #define SLAP_CONTROL_IGNORED   1
@@ -2464,8 +2469,8 @@ typedef struct slap_op {
 #define o_dontUseCopy                  o_ctrlflag[slap_cids.sc_dontUseCopy]
 #define get_dontUseCopy(op)            _SCM((op)->o_dontUseCopy)
 
-#define o_managedit                            o_ctrlflag[slap_cids.sc_manageDIT]
-#define get_manageDIT(op)              _SCM((op)->o_managedit)
+#define o_relax                                o_ctrlflag[slap_cids.sc_relax]
+#define get_relax(op)          _SCM((op)->o_relax)
 
 #define o_managedsait  o_ctrlflag[slap_cids.sc_manageDSAit]
 #define get_manageDSAit(op)                            _SCM((op)->o_managedsait)
@@ -2507,7 +2512,7 @@ typedef struct slap_op {
 #define o_pagedresults_state   o_controls[slap_cids.sc_pagedResults]
 #define get_pagedresults(op)                   ((int)(op)->o_pagedresults)
 
-#ifdef LDAP_DEVEL
+#ifdef SLAP_SORTEDRESULTS
 #define o_sortedresults                o_ctrlflag[slap_cids.sc_sortedResults]
 #endif
 
@@ -2681,21 +2686,27 @@ typedef struct slap_conn {
        SEND_LDAP_INTERMEDIATE *c_send_ldap_intermediate;
 } Connection;
 
-#if defined(LDAP_SYSLOG) && defined(LDAP_DEBUG)
+#ifdef LDAP_DEBUG
+#ifdef LDAP_SYSLOG
+#ifdef LOG_LOCAL4
+#define SLAP_DEFAULT_SYSLOG_USER       LOG_LOCAL4
+#endif /* LOG_LOCAL4 */
+
 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \
        Log5( (level), ldap_syslog_level, (fmt), (connid), (opid), (arg1), (arg2), (arg3) )
 #define StatslogTest( level ) ((ldap_debug | ldap_syslog) & (level))
-#elif defined(LDAP_DEBUG)
+#else /* !LDAP_SYSLOG */
 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \
        do { \
                if ( ldap_debug & (level) ) \
                        fprintf( stderr, (fmt), (connid), (opid), (arg1), (arg2), (arg3) );\
        } while (0)
 #define StatslogTest( level ) (ldap_debug & (level))
-#else
+#endif /* !LDAP_SYSLOG */
+#else /* !LDAP_DEBUG */
 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) ((void) 0)
 #define StatslogTest( level ) (0)
-#endif
+#endif /* !LDAP_DEBUG */
 
 /*
  * listener; need to access it from monitor backend
@@ -2722,7 +2733,7 @@ struct slap_listener {
 /*
  * Operation indices
  */
-enum {
+typedef enum {
        SLAP_OP_BIND = 0,
        SLAP_OP_UNBIND,
        SLAP_OP_ADD,
@@ -2734,7 +2745,7 @@ enum {
        SLAP_OP_ABANDON,
        SLAP_OP_EXTENDED,
        SLAP_OP_LAST
-};
+} slap_op_t;
 
 typedef struct slap_counters_t {
        ldap_pvt_thread_mutex_t sc_sent_mutex;
@@ -2767,7 +2778,7 @@ typedef struct slap_counters_t {
 #define SLAP_CTRL_HIDE                         0x80000000U
 #endif
 
-#define SLAP_CTRL_REQUIRES_ROOT                0x40000000U /* for ManageDIT */
+#define SLAP_CTRL_REQUIRES_ROOT                0x40000000U /* for Relax */
 
 #define SLAP_CTRL_GLOBAL                       0x00800000U
 #define SLAP_CTRL_GLOBAL_SEARCH                0x00010000U     /* for NOOP */