+#ifdef LDAP_COMP_MATCH
+/*
+ * Extensible Filter Definition
+ *
+ * MatchingRuleAssertion := SEQUENCE {
+ * matchingRule [1] MatchingRuleId OPTIONAL,
+ * type [2] AttributeDescription OPTIONAL,
+ * matchValue [3] AssertionValue,
+ * dnAttributes [4] BOOLEAN DEFAULT FALSE }
+ *
+ * Following ComponentFilter is contained in matchValue
+ *
+ * ComponentAssertion ::= SEQUENCE {
+ * component ComponentReference (SIZE(1..MAX)) OPTIONAL
+ * useDefaultValues BOOLEAN DEFAULT TRUE,
+ * rule MATCHING-RULE.&id,
+ * value MATCHING-RULE.&AssertionType }
+ *
+ * ComponentFilter ::= CHOICE {
+ * item [0] ComponentAssertion,
+ * and [1] SEQUENCE OF ComponentFilter,
+ * or [2] SEQUENCE OF ComponentFilter,
+ * not [3] ComponentFilter }
+ */
+
+#define LDAP_COMPREF_IDENTIFIER ((ber_tag_t) 0x80U)
+#define LDAP_COMPREF_FROM_BEGINNING ((ber_tag_t) 0x81U)
+#define LDAP_COMPREF_COUNT ((ber_tag_t) 0x82U)
+#define LDAP_COMPREF_FROM_END ((ber_tag_t) 0x83U)
+#define LDAP_COMPREF_CONTENT ((ber_tag_t) 0x84U)
+#define LDAP_COMPREF_SELECT ((ber_tag_t) 0x85U)
+#define LDAP_COMPREF_ALL ((ber_tag_t) 0x86U)
+#define LDAP_COMPREF_DEFINED ((ber_tag_t) 0x87U)
+#define LDAP_COMPREF_UNDEFINED ((ber_tag_t) 0x88U)
+
+#define LDAP_COMP_FILTER_AND ((ber_tag_t) 0xa0U)
+#define LDAP_COMP_FILTER_OR ((ber_tag_t) 0xa1U)
+#define LDAP_COMP_FILTER_NOT ((ber_tag_t) 0xa2U)
+#define LDAP_COMP_FILTER_ITEM ((ber_tag_t) 0xa3U)
+#define LDAP_COMP_FILTER_UNDEFINED ((ber_tag_t) 0xa4U)
+
+typedef struct slap_component_id{
+ int ci_type;
+ struct slap_component_id *ci_next;
+
+ union comp_id_value{
+ BerValue ci_identifier;
+ ber_int_t ci_from_beginning;
+ ber_int_t ci_count;
+ ber_int_t ci_from_end;
+ BerValue ci_select_value;
+ char ci_all;
+ } ci_val;
+} ComponentId;
+
+typedef struct slap_component_reference {
+ ComponentId *cr_list;
+ ComponentId *cr_curr;
+ struct berval cr_string;
+ int cr_len;
+} ComponentReference;
+
+typedef struct slap_component_assertion {
+ ComponentReference *ca_comp_ref;
+ 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;
+
+typedef struct slap_component_filter {
+ ber_tag_t cf_choice;
+ union cf_un_u {
+ ber_int_t cf_un_result;
+ ComponentAssertion *cf_un_ca;
+ struct slap_component_filter *cf_un_complex;
+ } cf_un;
+
+#define cf_ca cf_un.cf_un_ca
+#define cf_result cf_un.cf_un_result
+#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;
+
+typedef struct slap_component_assertion_value {
+ char* cav_buf;
+ char* cav_ptr;
+ char* cav_end;
+} ComponentAssertionValue;
+/*
+typedef int encoder_func LDAP_P((
+ void* b,
+ void* comp));*/
+
+struct slap_component_syntax_info;
+
+typedef int gser_decoder_func LDAP_P((
+ void* b,
+ struct slap_component_syntax_info* comp_syn_info,
+ int* len,
+ int mode));
+
+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,
+ struct slap_component_syntax_info* comp1,
+ struct slap_component_syntax_info* comp));
+
+typedef struct slap_component_desc{
+ int cd_tag;
+ 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;
+ 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 {
+ Syntax* csi_syntax;
+ ComponentDesc* csi_comp_desc;
+} ComponentSyntaxInfo;
+
+#endif