]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slap.h
Add comments
[openldap] / servers / slapd / slap.h
index bfca2373da304c2032a64b4a467663eae6a4dcf6..8994f3be6a6a98fd9c45dc0dcfe4759dcc56c065 100644 (file)
@@ -85,6 +85,7 @@ LDAP_BEGIN_DECL
 #define FILTER_ESCAPE(c) ( (c) == '*' || (c) == '\\' \
        || (c) == '(' || (c) == ')' || !ASCII_PRINTABLE(c) )
 
+#define DN_ESCAPE(c)   ((c) == SLAP_ESCAPE_CHAR)
 #define DN_SEPARATOR(c)        ((c) == ',' || (c) == ';')
 #define RDN_ATTRTYPEANDVALUE_SEPARATOR(c) ((c) == '+') /* RFC 2253 */
 #define RDN_SEPARATOR(c) (DN_SEPARATOR(c) || RDN_ATTRTYPEANDVALUE_SEPARATOR(c))
@@ -176,11 +177,10 @@ typedef struct slap_ssf_set {
 #define SLAP_INDEX_SUBSTR_MAXLEN       4
 #define SLAP_INDEX_SUBSTR_STEP 2
 
-#define SLAP_INDEX_FLAGS          0xF000UL
-#define SLAP_INDEX_SUBTYPES       0x1000UL /* use index with subtypes */
-#define SLAP_INDEX_AUTO_SUBTYPES  0x2000UL /* use mask with subtypes */
-#define SLAP_INDEX_LANG           0x4000UL /* use index with lang subtypes */
-#define SLAP_INDEX_AUTO_LANG      0x8000UL /* use mask with lang subtypes */
+#define SLAP_INDEX_FLAGS         0xF000UL
+#define SLAP_INDEX_NOSUBTYPES    0x1000UL /* don't use index w/ subtypes */
+#define SLAP_INDEX_NOLANG        0x2000UL /* don't use index w/ lang */
+#define SLAP_INDEX_AUTO_SUBTYPES 0x4000UL /* use mask with lang subtypes */
 
 /*
  * there is a single index for each attribute.  these prefixes ensure
@@ -343,10 +343,28 @@ typedef struct slap_matching_rule {
 #define SLAP_MR_SUBSTR_ANY             ( SLAP_MR_SUBSTR | 0x0020U )
 #define SLAP_MR_SUBSTR_FINAL   ( SLAP_MR_SUBSTR | 0x0040U )
 
-/* this is used to kludge objectClass testing */
-#define SLAP_MR_MODIFY_MATCHING 0x0001U
-/* are we matching from a mr asserted value or a real value */
-#define SLAP_MR_VALUE_IS_IN_MR_SYNTAX  0x0002U
+/*
+ * normally the provided value is expected to conform to
+ * assertion syntax specified in the matching rule, however
+ * at times (such as during individual value modification),
+ * the provided value is expected to conform to the
+ * attribute's value syntax.
+ */
+#define SLAP_MR_ASSERTION_SYNTAX_MATCH 0x0000U
+#define SLAP_MR_VALUE_SYNTAX_MATCH 0x0001U
+#define SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH 0x0003U
+
+#define SLAP_IS_MR_ASSERTION_SYNTAX_MATCH( usage ) \
+       (!((usage) & SLAP_MR_VALUE_SYNTAX_MATCH))
+#define SLAP_IS_MR_VALUE_SYNTAX_MATCH( usage ) \
+       ((usage) & SLAP_MR_VALUE_SYNTAX_MATCH)
+
+#define SLAP_IS_MR_VALUE_SYNTAX_CONVERTED_MATCH( usage ) \
+       (((usage) & SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH) \
+               == SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH)
+#define SLAP_IS_MR_VALUE_SYNTAX_NONCONVERTED_MATCH( usage ) \
+       (((usage) & SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH) \
+               == SLAP_MR_VALUE_SYNTAX_MATCH)
 
        Syntax                                  *smr_syntax;
        slap_mr_convert_func    *smr_convert;
@@ -370,7 +388,7 @@ struct slap_attr_desc;
 
 typedef struct slap_attribute_type {
        LDAPAttributeType               sat_atype;
-       char                            *sat_cname;
+       struct berval                   sat_cname;
        struct slap_attribute_type      *sat_sup;
        struct slap_attribute_type      **sat_subtypes;
        MatchingRule                    *sat_equality;
@@ -378,9 +396,9 @@ typedef struct slap_attribute_type {
        MatchingRule                    *sat_ordering;
        MatchingRule                    *sat_substr;
        Syntax                          *sat_syntax;
-       ldap_pvt_thread_mutex_t         sat_ad_mutex;
        struct slap_attr_desc           *sat_ad;
        struct slap_attribute_type      *sat_next;
+       ldap_pvt_thread_mutex_t         sat_ad_mutex;
 #define sat_oid                        sat_atype.at_oid
 #define sat_names              sat_atype.at_names
 #define sat_desc               sat_atype.at_desc
@@ -455,6 +473,8 @@ struct slap_internal_schema {
 
        /* operational attribute descriptions */
        AttributeDescription *si_ad_structuralObjectClass;
+       AttributeDescription *si_ad_entryUUID;
+       AttributeDescription *si_ad_entryCSN;
        AttributeDescription *si_ad_creatorsName;
        AttributeDescription *si_ad_createTimestamp;
        AttributeDescription *si_ad_modifiersName;
@@ -526,7 +546,6 @@ typedef struct slap_mr_assertion {
        struct berval                   *ma_value;      /* required */
 } MatchingRuleAssertion;
 
-
 /*
  * represents a search filter
  */
@@ -536,7 +555,6 @@ typedef struct slap_filter {
 #define SLAPD_FILTER_DN_ONE            ((ber_tag_t) -2)
 #define SLAPD_FILTER_DN_SUBTREE        ((ber_tag_t) -3)
 
-
        union f_un_u {
                /* precomputed result */
                ber_int_t f_un_result;
@@ -855,9 +873,17 @@ struct slap_limits {
        int     lm_type;        /* type of pattern */
 #define SLAP_LIMITS_UNDEFINED  0x0000
 #define SLAP_LIMITS_EXACT      0x0001
-#define SLAP_LIMITS_REGEX      0x0002
-       regex_t lm_dn_regex;    /* regex-based size and time limits */
-       char   *lm_dn_pat;      /* ndn for EXACT; pattern for REGEX */
+#define SLAP_LIMITS_BASE       SLAP_LIMITS_EXACT
+#define SLAP_LIMITS_ONE                0x0002
+#define SLAP_LIMITS_SUBTREE    0x0003
+#define SLAP_LIMITS_CHILDREN   0x0004
+#define SLAP_LIMITS_REGEX      0x0005
+#define SLAP_LIMITS_ANONYMOUS  0x0006
+#define SLAP_LIMITS_USERS      0x0007
+       regex_t lm_dn_regex;            /* regex data for REGEX */
+       struct berval *lm_dn_pat;       /* ndn for EXACT, BASE, ONE, SUBTREE,
+                                        * CHILDREN; pattern for REGEX; NULL
+                                        * for ANONYMOUS, USERS */
        struct slap_limits_set  lm_limits;
 };