#define SLAP_MR_ORDERING 0x0200U
#define SLAP_MR_SUBSTR 0x0400U
#define SLAP_MR_EXT 0x0800U /* implicitly extensible */
-#define SLAP_MR_ORDERED_INDEX 0x1000U
+#define SLAP_MR_ORDERED_INDEX 0x1000U
#ifdef LDAP_COMP_MATCH
#define SLAP_MR_COMPONENT 0x2000U
#endif
AttributeDescription *si_ad_distinguishedName;
AttributeDescription *si_ad_name;
AttributeDescription *si_ad_cn;
+ AttributeDescription *si_ad_uid;
AttributeDescription *si_ad_userPassword;
AttributeDescription *si_ad_labeledURI;
#ifdef SLAPD_AUTHPASSWD
struct slap_valuesreturnfilter *vrf_next;
} ValuesReturnFilter;
+#ifdef LDAP_COMP_MATCH
+typedef struct slap_component_data {
+ void* cd_mem_op;/* nibble memory handler */
+ void* cd_tree; /* component tree */
+} ComponentData;
+#endif
+
/*
* represents an attribute (description + values)
*/
AttributeDescription *a_desc;
BerVarray a_vals; /* preserved values */
BerVarray a_nvals; /* normalized values */
+#ifdef LDAP_COMP_MATCH
+ ComponentData *a_comp_data; /* component values */
+#endif
struct slap_attr *a_next;
unsigned a_flags;
#define SLAP_ATTR_IXADD 0x1U
#define SLAP_ATTR_IXDEL 0x2U
-#ifdef LDAP_COMP_MATCH
- void* a_component_values; /* component values */
-#endif
} Attribute;
} AuthorizationInformation;
-#if 0 /* LDAP_DEVEL */
+#ifdef LDAP_DEVEL
#define SLAP_DYNACL
#endif /* LDAP_DEVEL */
int si_manageDSAit;
int si_slimit;
int si_tlimit;
- struct berval si_syncUUID_ndn;
int si_refreshDelete;
int si_refreshPresent;
Avlnode *si_presentlist;
#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 */
+#define SLAP_DBFLAG_OVERLAY 0x0080U /* this db struct is an overlay */
#define SLAP_DBFLAG_SHADOW 0x8000U /* a shadow */
#define SLAP_DBFLAG_SYNC_SHADOW 0x1000U /* a sync shadow */
#define SLAP_DBFLAG_SLURP_SHADOW 0x2000U /* a slurp shadow */
#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_ISOVERLAY(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_OVERLAY)
#define SLAP_NO_SCHEMA_CHECK(be) \
(SLAP_DBFLAGS(be) & SLAP_DBFLAG_NO_SCHEMA_CHECK)
#define SLAP_GLUE_INSTANCE(be) \
struct be_pcl *be_pending_csn_list;
ldap_pvt_thread_mutex_t be_pcl_mutex;
ldap_pvt_thread_mutex_t *be_pcl_mutexp;
- struct berval be_context_csn;
LDAP_STAILQ_HEAD( be_si, syncinfo_s ) be_syncinfo; /* For syncrepl */
char *be_realm;
#define LDAP_PSEARCH_BY_SCOPEOUT 0x05
#define LDAP_PSEARCH_BY_PREDELETE 0x06
-struct psid_entry {
+struct psid_entry { /* DELETE ME */
struct slap_op *ps_op;
LDAP_LIST_ENTRY(psid_entry) ps_link;
};
+#if 0 /* DELETE ME */
struct slog_entry {
struct berval sl_uuid;
struct berval sl_name;
struct berval se_spec;
LDAP_LIST_ENTRY( slap_session_entry ) se_link;
};
+#endif
struct slap_csn_entry {
- struct berval *ce_csn;
+ struct berval ce_csn;
unsigned long ce_opid;
unsigned long ce_connid;
#define SLAP_CSN_PENDING 1
int sc_LDAPsync;
};
-typedef struct syncrepl_state {
- struct sync_cookie sr_state;
- int sr_rhint;
-} syncrepl_state;
/*
* represents an operation pending from an ldap client
*/
+typedef struct slap_op_header {
+ unsigned long oh_opid; /* id of this operation */
+ unsigned long oh_connid; /* id of conn initiating this op */
+ struct slap_conn *oh_conn; /* connection spawning this op */
+
+ ber_int_t oh_msgid; /* msgid of the request */
+ ber_int_t oh_protocol; /* version of the LDAP protocol used by client */
+
+ ldap_pvt_thread_t oh_tid; /* thread handling this op */
+
+ void *oh_threadctx; /* thread pool thread context */
+ void *oh_tmpmemctx; /* slab malloc context */
+ BerMemoryFunctions *oh_tmpmfuncs;
+
+ char oh_log_prefix[sizeof("conn=18446744073709551615 op=18446744073709551615")];
+
+#ifdef LDAP_SLAPI
+ void *oh_pb; /* NS-SLAPI plugin */
+ void *oh_extensions; /* NS-SLAPI plugin */
+#endif
+} Opheader;
+
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 */
+ Opheader *o_hdr;
+
+#define o_opid o_hdr->oh_opid
+#define o_connid o_hdr->oh_connid
+#define o_conn o_hdr->oh_conn
+#define o_msgid o_hdr->oh_msgid
+#define o_protocol o_hdr->oh_protocol
+#define o_tid o_hdr->oh_tid
+#define o_threadctx o_hdr->oh_threadctx
+#define o_tmpmemctx o_hdr->oh_tmpmemctx
+#define o_tmpmfuncs o_hdr->oh_tmpmfuncs
+
+#define o_tmpalloc o_tmpmfuncs->bmf_malloc
+#define o_tmpcalloc o_tmpmfuncs->bmf_calloc
+#define o_tmprealloc o_tmpmfuncs->bmf_realloc
+#define o_tmpfree o_tmpmfuncs->bmf_free
+
+#define o_log_prefix o_hdr->oh_log_prefix
+
+#ifdef LDAP_SLAPI
+#define o_pb o_hdr->oh_pb
+#define o_extensions o_hdr->oh_extensions
+#endif
- ber_int_t o_msgid; /* msgid of the request */
- ber_int_t o_protocol; /* version of the LDAP protocol used by client */
ber_tag_t o_tag; /* tag of the request */
time_t o_time; /* time op was initiated */
+ BackendDB *o_bd; /* backend DB processing this op */
struct berval o_req_dn; /* DN of target of request */
struct berval o_req_ndn;
#define ore_reqoid oq_extended.rs_reqoid
#define ore_flags oq_extended.rs_flags
#define ore_reqdata oq_extended.rs_reqdata
-
- ldap_pvt_thread_t o_tid; /* thread handling this op */
-
volatile sig_atomic_t o_abandon; /* abandon flag */
volatile sig_atomic_t o_cancel; /* cancel flag */
#define SLAP_CANCEL_NONE 0x00
#define o_pagedresults o_ctrlflag[slap_cids.sc_pagedResults]
#define o_pagedresults_state o_controls[slap_cids.sc_pagedResults]
-#define get_pagedresults(op) ((int)(op)->o_pagedresults)
+#define o_sync o_ctrlflag[slap_cids.sc_LDAPsync]
-#define o_sync o_ctrlflag[slap_cids.sc_LDAPsync]
- /* o_sync_mode uses data bits of o_sync */
-#define o_sync_mode o_ctrlflag[slap_cids.sc_LDAPsync]
+#define get_pagedresults(op) ((int)(op)->o_pagedresults)
-#define SLAP_SYNC_NONE (LDAP_SYNC_NONE<<SLAP_CONTROL_SHIFT)
-#define SLAP_SYNC_REFRESH (LDAP_SYNC_REFRESH_ONLY<<SLAP_CONTROL_SHIFT)
-#define SLAP_SYNC_PERSIST (LDAP_SYNC_RESERVED<<SLAP_CONTROL_SHIFT)
-#define SLAP_SYNC_REFRESH_AND_PERSIST (LDAP_SYNC_REFRESH_AND_PERSIST<<SLAP_CONTROL_SHIFT)
#ifdef BDB_PSEARCH
struct sync_cookie o_sync_state;
int o_sync_rhint;
slap_callback *o_callback; /* callback pointers */
LDAPControl **o_ctrls; /* controls */
- void *o_threadctx; /* thread pool thread context */
- void *o_tmpmemctx; /* slab malloc context */
- BerMemoryFunctions *o_tmpmfuncs;
-#define o_tmpalloc o_tmpmfuncs->bmf_malloc
-#define o_tmpcalloc o_tmpmfuncs->bmf_calloc
-#define o_tmprealloc o_tmpmfuncs->bmf_realloc
-#define o_tmpfree o_tmpmfuncs->bmf_free
void *o_private; /* anything the backend needs */
LDAP_STAILQ_ENTRY(slap_op) o_next; /* next operation in list */
-
int o_nocaching;
int o_delete_glue_parent;
-#ifdef LDAP_SLAPI
- void *o_pb; /* NS-SLAPI plugin */
- void *o_extensions; /* NS-SLAPI plugin */
-#endif
-
} Operation;
+#define OPERATION_BUFFER_SIZE (sizeof(Operation)+sizeof(Opheader)+SLAP_MAX_CIDS*sizeof(void *))
#define send_ldap_error( op, rs, err, text ) do { \
(rs)->sr_err = err; (rs)->sr_text = text; \
#define LDAP_COMP_FILTER_ITEM ((ber_tag_t) 0xa3U)
#define LDAP_COMP_FILTER_UNDEFINED ((ber_tag_t) 0xa4U)
-typedef struct slap_component_id{
+typedef struct slap_component_id {
int ci_type;
struct slap_component_id *ci_next;
ber_int_t ci_from_beginning;
ber_int_t ci_count;
ber_int_t ci_from_end;
+ ber_int_t ci_content;
BerValue ci_select_value;
char ci_all;
} ci_val;
ber_int_t ca_use_def;
MatchingRule *ca_ma_rule;
struct berval ca_ma_value;
- void* ca_component_values;
+ ComponentData ca_comp_data; /* componentized assertion */
struct slap_component_filter *ca_cf;
MatchingRuleAssertion *ca_mra;
} ComponentAssertion;
char* cav_ptr;
char* cav_end;
} ComponentAssertionValue;
-/*
+
+#if 0
typedef int encoder_func LDAP_P((
void* b,
- void* comp));*/
+ void* comp));
+#endif
struct slap_component_syntax_info;
typedef int gser_decoder_func LDAP_P((
+ void* mem_op,
void* b,
struct slap_component_syntax_info** comp_syn_info,
int* len,
void* b));
typedef int ber_decoder_func LDAP_P((
+ void* mem_op,
void* b,
int tag,
int elmtLen,
int mode));
typedef int ber_tag_decoder_func LDAP_P((
+ void* mem_op,
void* b,
struct slap_component_syntax_info* comp_syn_info,
int* len,
int mode));
typedef void* extract_component_from_id_func LDAP_P((
+ void* mem_op,
ComponentReference* cr,
void* comp ));
Syntax* syn,
struct berval* bv ));
+typedef void* alloc_nibble_func LDAP_P ((
+ int initial_size,
+ int increment_size ));
+
+typedef void free_nibble_func LDAP_P ((
+ void* nm ));
+
struct slap_component_syntax_info;
-typedef int convert_assert_to_comp_func LDAP_P ((
+typedef void* convert_assert_to_comp_func LDAP_P ((
struct slap_component_syntax_info* csi_attr,
struct berval* bv,
struct slap_component_syntax_info** csi,
struct berval *bv ));
typedef void free_component_func LDAP_P ((
- struct slap_component_syntax_info* csi ));
+ void* mem_op));
+
+typedef int test_component_func LDAP_P ((
+ void* mem_op,
+ struct slap_component_syntax_info* csi,
+ struct slap_component_assertion* ca));
typedef int allcomponent_matching_func LDAP_P((
char* oid,
int cd_tag;
int cd_type;
int cd_type_id;
+ int cd_compref_type;
gser_decoder_func *cd_gser_decoder;
ber_decoder_func *cd_ber_decoder;
comp_free_func *cd_free;