#include <ac/time.h>
#include <ac/param.h>
-#ifdef HAVE_GMP
-#include <gmp.h>
-#endif /* HAVE_GMP */
-
#include "avl.h"
#ifndef ldap_debug
#include <ldap_schema.h>
#include "lber_pvt.h"
+#include "ldap_pvt.h"
#include "ldap_pvt_thread.h"
#include "ldap_queue.h"
| SLAP_INDEX_SUBSTR_ANY \
| SLAP_INDEX_SUBSTR_FINAL )
-/* constants for initial/final substrings indices */
-#ifndef SLAP_INDEX_SUBSTR_IF_MINLEN
-# define SLAP_INDEX_SUBSTR_IF_MINLEN 2
-#endif
-#ifndef SLAP_INDEX_SUBSTR_IF_MAXLEN
-# define SLAP_INDEX_SUBSTR_IF_MAXLEN 4
-#endif
+/* defaults for initial/final substring indices */
+#define SLAP_INDEX_SUBSTR_IF_MINLEN_DEFAULT 2
+#define SLAP_INDEX_SUBSTR_IF_MAXLEN_DEFAULT 4
-/* constants for any substrings indices */
-#ifndef SLAP_INDEX_SUBSTR_ANY_LEN
-# define SLAP_INDEX_SUBSTR_ANY_LEN 4
-#endif
-#ifndef SLAP_INDEX_SUBSTR_ANY_STEP
-# define SLAP_INDEX_SUBSTR_ANY_STEP 2
-#endif
+/* defaults for any substring indices */
+#define SLAP_INDEX_SUBSTR_ANY_LEN_DEFAULT 4
+#define SLAP_INDEX_SUBSTR_ANY_STEP_DEFAULT 2
#define SLAP_INDEX_FLAGS 0xF000UL
#define SLAP_INDEX_NOSUBTYPES 0x1000UL /* don't use index w/ subtypes */
#define SLAP_MR_ORDERING 0x0200U
#define SLAP_MR_SUBSTR 0x0400U
#define SLAP_MR_EXT 0x0800U /* implicitly extensible */
+#define SLAP_MR_ORDERED_INDEX 0x1000U
#ifdef LDAP_COMP_MATCH
-#define SLAP_MR_COMPONENT 0x1000U
+#define SLAP_MR_COMPONENT 0x2000U
#endif
#define SLAP_MR_EQUALITY_APPROX ( SLAP_MR_EQUALITY | 0x0010U )
int si_slimit;
int si_tlimit;
struct berval si_syncUUID_ndn;
+ int si_refreshDelete;
+ int si_refreshPresent;
Avlnode *si_presentlist;
LDAP *si_ld;
LDAP_LIST_HEAD(np, nonpresent_entry) si_nonpresentlist;
AttributeName *rs_attrs;
Filter *rs_filter;
struct berval rs_filterstr;
+ int rs_post_search_id;
} req_search_s;
typedef struct req_compare_s {
#define LDAP_PSEARCH_BY_PREMODIFY 0x03
#define LDAP_PSEARCH_BY_MODIFY 0x04
#define LDAP_PSEARCH_BY_SCOPEOUT 0x05
+#define LDAP_PSEARCH_BY_PREDELETE 0x06
struct psid_entry {
struct slap_op *ps_op;
LDAP_TAILQ_ENTRY (slap_csn_entry) ce_csn_link;
};
+struct pc_entry {
+ ID pc_id;
+ int pc_sent;
+ struct berval pc_csn;
+ struct berval pc_entryUUID;
+ struct berval pc_ename;
+ struct berval pc_enname;
+ LDAP_TAILQ_ENTRY( pc_entry ) pc_link;
+};
+
/*
* Caches the result of a backend_group check for ACL evaluation
*/
typedef struct slap_op {
unsigned long o_opid; /* id of this operation */
unsigned long o_connid; /* id of conn initiating this op */
+ char o_log_prefix[sizeof("conn=18446744073709551615 op=18446744073709551615")];
struct slap_conn *o_conn; /* connection spawning this op */
BackendDB *o_bd; /* backend DB processing this op */
#define ors_attrs oq_search.rs_attrs
#define ors_filter oq_search.rs_filter
#define ors_filterstr oq_search.rs_filterstr
+#define ors_post_search_id oq_search.rs_post_search_id
#define orr_newrdn oq_modrdn.rs_newrdn
#define orr_nnewrdn oq_modrdn.rs_nnewrdn
LDAP_LIST_ENTRY(slap_op) o_ps_link;
LDAP_LIST_HEAD(pe, psid_entry) o_pm_list;
+ int o_refresh_in_progress;
+ LDAP_TAILQ_HEAD(pc_pre, pc_entry) o_ps_pre_candidates;
+ LDAP_TAILQ_HEAD(pc_post, pc_entry) o_ps_post_candidates;
+ Avlnode *o_psearch_finished;
+ struct pc_entry *o_ps_send_wait;
+ ldap_pvt_thread_mutex_t o_pcmutex;
+
AuthorizationInformation o_authz;
BerElement *o_ber; /* ber of the request */
typedef struct slap_counters_t {
ldap_pvt_thread_mutex_t sc_sent_mutex;
-#ifdef HAVE_GMP
- mpz_t sc_bytes;
- mpz_t sc_pdu;
- mpz_t sc_entries;
- mpz_t sc_refs;
-#else /* ! HAVE_GMP */
- unsigned long sc_bytes;
- unsigned long sc_pdu;
- unsigned long sc_entries;
- unsigned long sc_refs;
-#endif /* ! HAVE_GMP */
+ ldap_pvt_mp_t sc_bytes;
+ ldap_pvt_mp_t sc_pdu;
+ ldap_pvt_mp_t sc_entries;
+ ldap_pvt_mp_t sc_refs;
ldap_pvt_thread_mutex_t sc_ops_mutex;
-#ifdef HAVE_GMP
- mpz_t sc_ops_completed;
- mpz_t sc_ops_initiated;
+ ldap_pvt_mp_t sc_ops_completed;
+ ldap_pvt_mp_t sc_ops_initiated;
#ifdef SLAPD_MONITOR
- mpz_t sc_ops_completed_[SLAP_OP_LAST];
- mpz_t sc_ops_initiated_[SLAP_OP_LAST];
+ ldap_pvt_mp_t sc_ops_completed_[SLAP_OP_LAST];
+ ldap_pvt_mp_t sc_ops_initiated_[SLAP_OP_LAST];
#endif /* SLAPD_MONITOR */
-#else /* ! HAVE_GMP */
- unsigned long sc_ops_completed;
- unsigned long sc_ops_initiated;
-#ifdef SLAPD_MONITOR
- unsigned long sc_ops_completed_[SLAP_OP_LAST];
- unsigned long sc_ops_initiated_[SLAP_OP_LAST];
-#endif /* SLAPD_MONITOR */
-#endif /* ! HAVE_GMP */
} slap_counters_t;
-#define num_sent_mutex slap_counters.sc_sent_mutex
-#define num_bytes_sent slap_counters.sc_bytes
-#define num_pdu_sent slap_counters.sc_pdu
-#define num_entries_sent slap_counters.sc_entries
-#define num_refs_sent slap_counters.sc_refs
-#define num_ops_mutex slap_counters.sc_ops_mutex
-#define num_ops_completed slap_counters.sc_ops_completed
-#define num_ops_initiated slap_counters.sc_ops_initiated
-#define num_ops_completed_ slap_counters.sc_ops_completed_
-#define num_ops_initiated_ slap_counters.sc_ops_initiated_
-
/*
* Better know these all around slapd
*/
ber_int_t ca_use_def;
MatchingRule *ca_ma_rule;
struct berval ca_ma_value;
+ void* ca_component_values;
struct slap_component_filter *ca_cf;
MatchingRuleAssertion *ca_mra;
} ComponentAssertion;
#define cf_and cf_un.cf_un_complex
#define cf_or cf_un.cf_un_complex
#define cf_not cf_un.cf_un_complex
+#define cf_any cf_un.cf_un_complex
struct slap_component_filter *cf_next;
} ComponentFilter;
char* cav_ptr;
char* cav_end;
} ComponentAssertionValue;
-
-#include "asn.h"
-
+/*
typedef int encoder_func LDAP_P((
void* b,
- void* comp));
+ void* comp));*/
struct slap_component_syntax_info;
-typedef int decoder_func LDAP_P((
+typedef int gser_decoder_func LDAP_P((
void* b,
- struct slap_component_syntax_info** comp_syn_info,
- unsigned int* len,
+ struct slap_component_syntax_info* comp_syn_info,
+ int* len,
int mode));
-typedef void* extract_component_from_tag_func LDAP_P((
- int *tag));
+typedef int comp_free_func LDAP_P((
+ void* b));
+
+typedef int ber_decoder_func LDAP_P((
+ void* b,
+ int tag,
+ int elmtLen,
+ struct slap_component_syntax_info* comp_syn_info,
+ int* len,
+ int mode));
+
+typedef int ber_tag_decoder_func LDAP_P((
+ void* b,
+ struct slap_component_syntax_info* comp_syn_info,
+ int* len,
+ int mode));
typedef void* extract_component_from_id_func LDAP_P((
ComponentReference* cr,
void* comp ));
+typedef void* convert_attr_to_comp_func LDAP_P ((
+ Attribute* a,
+ Syntax* syn,
+ struct berval* bv ));
+
+struct slap_component_syntax_info;
+typedef int convert_assert_to_comp_func LDAP_P ((
+ struct slap_component_syntax_info* csi_attr,
+ struct berval* bv,
+ struct slap_component_syntax_info** csi,
+ int* len,
+ int mode ));
+
+typedef int convert_asn_to_ldap_func LDAP_P ((
+ struct slap_component_syntax_info* csi,
+ struct berval *bv ));
+
+typedef void free_component_func LDAP_P ((
+ struct slap_component_syntax_info* csi ));
+
typedef int allcomponent_matching_func LDAP_P((
char* oid,
- void* component1,
- void* component2 ));
+ struct slap_component_syntax_info* comp1,
+ struct slap_component_syntax_info* comp));
typedef struct slap_component_desc{
int cd_tag;
- ComponentId* cd_identifier;
- encoder_func *cd_encoder;
- decoder_func *cd_decoder;
- extract_component_from_tag_func* cd_extract_t;
+ int cd_type;
+ int cd_type_id;
+ gser_decoder_func *cd_gser_decoder;
+ ber_decoder_func *cd_ber_decoder;
+ comp_free_func *cd_free;
extract_component_from_id_func* cd_extract_i;
- AsnType cd_type;
- AsnTypeId cd_type_id;
- allcomponent_matching_func* cd_all_match;
+ slap_syntax_validate_func *cd_validate;
+ slap_syntax_transform_func *cd_pretty;
+ allcomponent_matching_func *cd_all_match;
} ComponentDesc;
typedef struct slap_component_syntax_info {
ComponentDesc* csi_comp_desc;
} ComponentSyntaxInfo;
-typedef struct asntype_to_matchingrule {
- AsnTypeId atmr_typeId;
- char* atmr_mr_name;
- MatchingRule *atmr_mr;
-} AsnTypetoMatchingRule;
-
-typedef struct asntype_to_matchingrule_table {
- char* atmr_oid;
- struct asntype_to_matchingrule atmr_table[ASNTYPE_END];
- struct asntype_to_matchingrule_table* atmr_table_next;
-} AsnTypetoMatchingRuleTable;
-
#endif
LDAP_END_DECL