]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_prep.c
group rewrite/map stuff in one structure and optimize more function calls
[openldap] / servers / slapd / schema_prep.c
index b9bf64226eb6ad594e3cd3f703dd6487fe42839e..9a3ee2526eba440cb6387b50a25fa692ba7b8de0 100644 (file)
@@ -1,7 +1,7 @@
 /* schema_init.c - init builtin schema */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -90,7 +90,8 @@ objectSubClassMatch(
                return SLAPD_COMPARE_UNDEFINED;
        }
 
-       if( SLAP_IS_MR_VALUE_SYNTAX_MATCH( flags ) ) {
+       if( SLAP_MR_IS_VALUE_OF_ATTRIBUTE_SYNTAX( flags ) )
+       {
                *matchp = ( asserted != oc );
        } else {
                *matchp = !is_object_subclass( asserted, oc );
@@ -301,7 +302,7 @@ static struct slap_schema_oc_map {
                        "SUP top STRUCTURAL MAY cn )",
                rootDseObjectClass, SLAP_OC_OPERATIONAL,
                offsetof(struct slap_internal_schema, si_oc_rootdse) },
-       { "subentry", "( 2.5.20.0 NAME 'subentry' "
+       { "subentry", "( 2.5.17.0 NAME 'subentry' "
                        "SUP top STRUCTURAL "
                        "MUST ( cn $ subtreeSpecification ) )",
                subentryObjectClass, SLAP_OC_SUBENTRY|SLAP_OC_OPERATIONAL,
@@ -320,7 +321,8 @@ static struct slap_schema_oc_map {
                "MUST cn )",
                0, SLAP_OC_OPERATIONAL,
                offsetof(struct slap_internal_schema, si_oc_monitor) },
-       { "collectiveAttributeSubentry", "( 2.5.20.2 "
+#ifdef LDAP_DEVEL
+       { "collectiveAttributeSubentry", "( 2.5.17.2 "
                        "NAME 'collectiveAttributeSubentry' "
                        "AUXILIARY )",
                subentryObjectClass,
@@ -332,6 +334,7 @@ static struct slap_schema_oc_map {
                        "SUP top AUXILIARY )",
                dynamicObjectClass, SLAP_OC_DYNAMICOBJECT,
                offsetof(struct slap_internal_schema, si_oc_dynamicObject) },
+#endif
        { NULL, NULL, NULL, 0, 0 }
 };
 
@@ -423,6 +426,7 @@ static struct slap_schema_ad_map {
                NULL, 0,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_subschemaSubentry) },
+#ifdef LDAP_DEVEL
        { "collectiveAttributeSubentries", "( 2.5.18.12 "
                        "NAME 'collectiveAttributeSubentries' "
                        "EQUALITY distinguishedNameMatch "
@@ -438,9 +442,10 @@ static struct slap_schema_ad_map {
                NULL, SLAP_AT_HIDE,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_collectiveExclusions) },
+#endif
 
        { "entryUUID", "( 1.3.6.1.4.1.4203.666.1.6 NAME 'entryUUID' "   
-                       "DESC 'LCUP/LDUP: universally unique identifier' "
+                       "DESC 'LCUP/LDUP: UUID of the entry' "
                        "EQUALITY octetStringMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
@@ -448,16 +453,44 @@ static struct slap_schema_ad_map {
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_entryUUID) },
        { "entryCSN", "( 1.3.6.1.4.1.4203.666.1.7 NAME 'entryCSN' "
-                       "DESC 'LCUP/LDUP: change sequence number' "
+                       "DESC 'LCUP/LDUP: change sequence number of the entry content' "
                        "EQUALITY octetStringMatch "
-#ifdef LDAP_CLIENT_UPDATE
                        "ORDERING octetStringOrderingMatch "
-#endif /* LDAP_CLIENT_UPDATE */
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
                NULL, SLAP_AT_HIDE,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_entryCSN) },
+       { "namingCSN", "( 1.3.6.1.4.1.4203.666.1.13 NAME 'namingCSN' "
+                       "DESC 'LCUP/LDUP: change sequence number of the entry naming (RDN)' "
+                       "EQUALITY octetStringMatch "
+                       "ORDERING octetStringOrderingMatch "
+                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
+                       "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
+               NULL, SLAP_AT_HIDE,
+               NULL, NULL, NULL, NULL, NULL,
+               offsetof(struct slap_internal_schema, si_ad_namingCSN) },
+
+       { "superiorUUID", "( 1.3.6.1.4.1.4203.666.1.11 NAME 'superiorUUID' "   
+                       "DESC 'LCUP/LDUP: UUID of the superior entry' "
+                       "EQUALITY octetStringMatch "
+                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
+                       "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
+               NULL, SLAP_AT_HIDE,
+               NULL, NULL, NULL, NULL, NULL,
+               offsetof(struct slap_internal_schema, si_ad_superiorUUID) },
+
+#ifdef LDAP_CACHING 
+       /* LDAP cache specific operational attribute */
+       { "queryid", "( 1.3.6.1.4.1.4203.666.1.12 NAME 'queryid' "
+                       "DESC 'list of queries the entry belongs to' "
+                       "EQUALITY octetStringMatch "
+                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
+                       "NO-USER-MODIFICATION USAGE directoryOperation )",
+               NULL, 0, /* SLAP_AT_HIDE or SLAP_AT_NONE ? */
+               NULL, NULL, NULL, NULL, NULL, 
+               offsetof(struct slap_internal_schema, si_ad_queryid) },
+#endif /* LDAP_CACHING */
 
        /* root DSE attributes */
        { "altServer", "( 1.3.6.1.4.1.1466.101.120.6 NAME 'altServer' "
@@ -513,8 +546,7 @@ static struct slap_schema_ad_map {
        { "monitorContext", "( 1.3.6.1.4.1.4203.666.1.10 "
                        "NAME 'monitorContext' "
                        "DESC 'monitor context' "
-                       "EQUALITY objectIdentifierMatch "
-                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 "
+                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
                        "SINGLE-VALUE NO-USER-MODIFICATION "
                        "USAGE dSAOperation )",
                rootDseAttribute, SLAP_AT_HIDE,
@@ -680,6 +712,7 @@ static struct slap_schema_ad_map {
                offsetof(struct slap_internal_schema, si_ad_aci) },
 #endif
 
+#ifdef LDAP_DEVEL
        { "entryTtl", "( 1.3.6.1.4.1.1466.101.119.3 NAME 'entryTtl' "
                        "DESC 'RFC2589: entry time-to-live' "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE "
@@ -695,6 +728,7 @@ static struct slap_schema_ad_map {
                rootDseAttribute, 0,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_dynamicSubtrees) },
+#endif
 
        /* userApplication attributes (which system schema depends upon) */
        { "distinguishedName", "( 2.5.4.49 NAME 'distinguishedName' "
@@ -757,13 +791,13 @@ static struct slap_schema_ad_map {
                offsetof(struct slap_internal_schema, si_ad_krbName) },
 #endif
 
-       { NULL, NULL, NULL, 0, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0 }
 };
 
 static AttributeType slap_at_undefined = {
        { "1.1.1", NULL, NULL, 1, NULL,
                NULL, NULL, NULL, NULL,
-               0, 0, 0, 1, 3 }, /* LDAPAttributeType */
+               0, 0, 0, 1, 3, NULL }, /* LDAPAttributeType */
        { sizeof("UNDEFINED")-1, "UNDEFINED" }, /* cname */
        NULL, /* sup */
        NULL, /* subtypes */
@@ -771,7 +805,7 @@ static AttributeType slap_at_undefined = {
        NULL, /* syntax (this may need to be defined) */
        (AttributeTypeSchemaCheckFN *) 0, /* schema check function */
        SLAP_AT_ABSTRACT|SLAP_AT_FINAL, /* mask */
-       NULL, /* next */
+       { NULL }, /* next */
        NULL /* attribute description */
        /* mutex (don't know how to initialize it :) */
 };
@@ -780,10 +814,18 @@ static struct slap_schema_mr_map {
        char *ssmm_name;
        size_t ssmm_offset;
 } mr_map[] = {
+       { "caseExactIA5Match",
+               offsetof(struct slap_internal_schema, si_mr_caseExactIA5Match) },
+       { "caseExactMatch",
+               offsetof(struct slap_internal_schema, si_mr_caseExactMatch) },
+       { "caseExactSubstringsMatch",
+               offsetof(struct slap_internal_schema, si_mr_caseExactSubstringsMatch) },
        { "distinguishedNameMatch",
                offsetof(struct slap_internal_schema, si_mr_distinguishedNameMatch) },
        { "integerMatch",
                offsetof(struct slap_internal_schema, si_mr_integerMatch) },
+       { "integerFirstComponentMatch", offsetof(struct slap_internal_schema,
+               si_mr_integerFirstComponentMatch) },
        { NULL, 0 }
 };
 
@@ -791,12 +833,14 @@ static struct slap_schema_syn_map {
        char *sssm_name;
        size_t sssm_offset;
 } syn_map[] = {
-       { "1.3.6.1.4.1.1466.115.121.1.40",
-               offsetof(struct slap_internal_schema, si_syn_octetString) },
+       { "1.3.6.1.4.1.1466.115.121.1.15",
+               offsetof(struct slap_internal_schema, si_syn_directoryString) },
        { "1.3.6.1.4.1.1466.115.121.1.12",
                offsetof(struct slap_internal_schema, si_syn_distinguishedName) },
        { "1.3.6.1.4.1.1466.115.121.1.27",
                offsetof(struct slap_internal_schema, si_syn_integer) },
+       { "1.3.6.1.4.1.1466.115.121.1.40",
+               offsetof(struct slap_internal_schema, si_syn_octetString) },
        { NULL, 0 }
 };