]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/proto-slap.h
Add validation.
[openldap] / servers / slapd / proto-slap.h
index e278a0bd72f902f955d1566b1916911e265b3a73..444fbe4b5b5fcf0527e6386253e13710d62dc619 100644 (file)
@@ -16,7 +16,8 @@ LDAP_BEGIN_DECL
 LDAP_SLAPD_F (int) access_allowed LDAP_P((
        Backend *be, Connection *conn, Operation *op,
        Entry *e, AttributeDescription *desc, struct berval *val,
-       slap_access_t access ));
+       slap_access_t access,
+       AccessControlState *state ));
 LDAP_SLAPD_F (int) acl_check_modlist LDAP_P((
        Backend *be, Connection *conn, Operation *op,
        Entry *e, Modifications *ml ));
@@ -168,7 +169,7 @@ LDAP_SLAPD_F (BackendDB *) select_backend LDAP_P((
        int noSubordinates ));
 
 LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be,
-       const char *suffix ));
+       struct berval *suffix ));
 LDAP_SLAPD_F (int) be_isroot LDAP_P(( Backend *be,
        struct berval *ndn ));
 LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Backend *be,
@@ -349,6 +350,8 @@ LDAP_SLAPD_F (void) slapd_clr_read LDAP_P((ber_socket_t s, int wake));
 
 #define dn_match(dn1, dn2)     ( ber_bvcmp((dn1), (dn2)) == 0 )
 
+LDAP_SLAPD_V( const struct berval ) slap_empty_bv;
+
 LDAP_SLAPD_F (int) dnValidate LDAP_P((
        Syntax *syntax, 
        struct berval *val ));
@@ -402,14 +405,7 @@ LDAP_SLAPD_F (void) build_new_dn LDAP_P((
        struct berval * parent_dn,
        struct berval * newrdn ));
 
-LDAP_SLAPD_F (int) dnParent LDAP_P(( const char *dn, const char **pdn ));
-
-#define SLAP_DN_MIGRATION
-#ifdef SLAP_DN_MIGRATION
-       /* These routines are deprecated!!! */
-LDAP_SLAPD_F (char *) dn_normalize LDAP_P(( char *dn ));
-LDAP_SLAPD_F (char *) dn_parent LDAP_P(( Backend *be, const char *dn ));
-#endif
+LDAP_SLAPD_F (void) dnParent LDAP_P(( struct berval *dn, struct berval *pdn ));
 
 /*
  * entry.c
@@ -445,10 +441,6 @@ typedef int (SLAP_EXTOP_MAIN_FN) LDAP_P((
 typedef int (SLAP_EXTOP_GETOID_FN) LDAP_P((
        int index, char *oid, int blen ));
 
-LDAP_SLAPD_F (int) load_extension LDAP_P((
-       const void *module, const char *file_name));
-LDAP_SLAPD_F (char *) get_supported_extension LDAP_P((int index));
-
 LDAP_SLAPD_F (int) load_extop LDAP_P((
        const char *ext_oid,
        SLAP_EXTOP_MAIN_FN *ext_main ));
@@ -457,7 +449,7 @@ LDAP_SLAPD_F (int) extops_init LDAP_P(( void ));
 
 LDAP_SLAPD_F (int) extops_kill LDAP_P(( void ));
 
-LDAP_SLAPD_F (char *) get_supported_extop LDAP_P((int index));
+LDAP_SLAPD_F (struct berval *) get_supported_extop LDAP_P((int index));
 
 /*
  * filter.c
@@ -482,7 +474,6 @@ LDAP_SLAPD_F (int) test_filter LDAP_P((
 /*
  * index.c
  */
-LDAP_SLAPD_F (int) slap_index2prefix LDAP_P(( int indextype ));
 LDAP_SLAPD_F (int) slap_str2index LDAP_P(( const char *str, slap_mask_t *idx ));
 
 /*
@@ -624,8 +615,8 @@ LDAP_SLAPD_F (ObjectClass *) oc_find LDAP_P((
 LDAP_SLAPD_F (ObjectClass *) oc_bvfind LDAP_P((
        struct berval *ocname));
 LDAP_SLAPD_F (int) is_object_subclass LDAP_P((
-       ObjectClass *sub,
-       ObjectClass *sup ));
+       ObjectClass *sup,
+       ObjectClass *sub ));
 
 LDAP_SLAPD_F (int) is_entry_objectclass LDAP_P((
        Entry *, ObjectClass *oc, int set_flags ));
@@ -638,9 +629,9 @@ LDAP_SLAPD_F (int) is_entry_objectclass LDAP_P((
 #define is_entry_subentry(e)   \
        (((e)->e_ocflags & SLAP_OC__END) ? ((e)->e_ocflags & SLAP_OC_SUBENTRY) : \
        is_entry_objectclass((e), slap_schema.si_oc_subentry, 1))
-#define is_entry_collectiveAttributes(e)       \
-       (((e)->e_ocflags & SLAP_OC__END) ? ((e)->e_ocflags & SLAP_OC_COLLECTIVEATTRIBUTES) : \
-       is_entry_objectclass((e), slap_schema.si_oc_collectiveAttributes, 1))
+#define is_entry_collectiveAttributeSubentry(e)        \
+       (((e)->e_ocflags & SLAP_OC__END) ? ((e)->e_ocflags & SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY) : \
+       is_entry_objectclass((e), slap_schema.si_oc_collectiveAttributeSubentry, 1))
 #define is_entry_dynamicObject(e)      \
        (((e)->e_ocflags & SLAP_OC__END) ? ((e)->e_ocflags & SLAP_OC_DYNAMICOBJECT) : \
        is_entry_objectclass((e), slap_schema.si_oc_dynamicObject, 1))
@@ -726,6 +717,8 @@ LDAP_SLAPD_F (int) add_replica_info LDAP_P(( Backend *be,
        const char *host ));
 LDAP_SLAPD_F (int) add_replica_suffix LDAP_P(( Backend *be,
        int nr, const char *suffix ));
+LDAP_SLAPD_F (int) add_replica_attrs LDAP_P(( Backend *be,
+       int nr, char *attrs ));
 LDAP_SLAPD_F (void) replog LDAP_P(( Backend *be, Operation *op,
        struct berval *dn, struct berval *ndn, void *change ));
 
@@ -815,15 +808,17 @@ LDAP_SLAPD_F (int) slap_sasl_bind LDAP_P((
        Connection *conn, Operation *op, 
        struct berval *dn, struct berval *ndn,
        struct berval *cred,
-       char **edn, slap_ssf_t *ssf ));
+       struct berval *edn, slap_ssf_t *ssf ));
 
 /*
  * saslauthz.c
  */
-LDAP_SLAPD_F (char *) slap_sasl2dn LDAP_P((    char *saslname ));
+LDAP_SLAPD_F (void) slap_sasl2dn LDAP_P((
+       struct berval *saslname,
+       struct berval *dn ));
 LDAP_SLAPD_F (int) slap_sasl_authorized LDAP_P((
-       char *authcid,
-       char *authzid ));
+       struct berval *authcid,
+       struct berval *authzid ));
 LDAP_SLAPD_F (int) slap_sasl_regexp_config LDAP_P((
        const char *match, const char *replace ));
 
@@ -947,12 +942,22 @@ LDAP_SLAPD_F (void) slap_init_user LDAP_P(( char *username, char *groupname ));
 /*
  * value.c
  */
+LDAP_SLAPD_F (int) value_validate LDAP_P((
+       MatchingRule *mr,
+       struct berval *in,
+       const char ** text ));
 LDAP_SLAPD_F (int) value_normalize LDAP_P((
        AttributeDescription *ad,
        unsigned usage,
        struct berval *in,
        struct berval *out,
        const char ** text ));
+LDAP_SLAPD_F (int) value_validate_normalize LDAP_P((
+       AttributeDescription *ad,
+       unsigned usage,
+       struct berval *in,
+       struct berval *out,
+       const char ** text ));
 LDAP_SLAPD_F (int) value_match LDAP_P((
        int *match,
        AttributeDescription *ad,