From: Kurt Zeilenga Date: Wed, 30 Jul 2003 10:21:57 +0000 (+0000) Subject: preliminary modify/increment client side code X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~810 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c9a2f46b9eaa7acf4ac7b7333da76243425ff82;p=openldap preliminary modify/increment client side code --- diff --git a/include/ldap.h b/include/ldap.h index 2740ccdebc..81194df71c 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -248,6 +248,7 @@ typedef struct ldapcontrol { #define LDAP_FEATURE_ABSOLUTE_FILTERS "1.3.6.1.4.1.4203.1.5.3" /* (&) (|) */ #define LDAP_FEATURE_LANGUAGE_TAG_OPTIONS "1.3.6.1.4.1.4203.1.5.4" #define LDAP_FEATURE_LANGUAGE_RANGE_OPTIONS "1.3.6.1.4.1.4203.1.5.5" +#define LDAP_FEATURE_MODIFY_INCREMENT "1.3.6.1.4.1.4203.1.5.6" /* * specific LDAP instantiations of BER types we know about @@ -506,9 +507,11 @@ typedef struct ldapmsg LDAPMessage; typedef struct ldapmod { int mod_op; +#define LDAP_MOD_OP (0x0007) #define LDAP_MOD_ADD (0x0000) #define LDAP_MOD_DELETE (0x0001) #define LDAP_MOD_REPLACE (0x0002) +#define LDAP_MOD_INCREMENT (0x0003) #define LDAP_MOD_BVALUES (0x0080) /* IMPORTANT: do not use code 0x1000 (or above), * it is used internally by the backends! diff --git a/libraries/libldap/modify.c b/libraries/libldap/modify.c index ba7a15c501..7704737209 100644 --- a/libraries/libldap/modify.c +++ b/libraries/libldap/modify.c @@ -41,7 +41,9 @@ * Example: * LDAPMod *mods[] = { * { LDAP_MOD_ADD, "cn", { "babs jensen", "babs", 0 } }, - * { LDAP_MOD_REPLACE, "sn", { "jensen", 0 } }, + * { LDAP_MOD_REPLACE, "sn", { "babs jensen", "babs", 0 } }, + * { LDAP_MOD_DELETE, "ou", 0 }, + * { LDAP_MOD_INCREMENT, "uidNumber, { "1", 0 } } * 0 * } * rc= ldap_modify_ext( ld, dn, mods, sctrls, cctrls, &msgid ); @@ -65,8 +67,9 @@ ldap_modify_ext( LDAP *ld, * modifications SEQUENCE OF SEQUENCE { * operation ENUMERATED { * add (0), - * delete (1), - * replace (2) + * delete (1), + * replace (2), + * increment (3) -- extension * }, * modification SEQUENCE { * type AttributeType, @@ -155,7 +158,9 @@ ldap_modify_ext( LDAP *ld, * Example: * LDAPMod *mods[] = { * { LDAP_MOD_ADD, "cn", { "babs jensen", "babs", 0 } }, - * { LDAP_MOD_REPLACE, "sn", { "jensen", 0 } }, + * { LDAP_MOD_REPLACE, "sn", { "babs jensen", "babs", 0 } }, + * { LDAP_MOD_DELETE, "ou", 0 }, + * { LDAP_MOD_INCREMENT, "uidNumber, { "1", 0 } } * 0 * } * msgid = ldap_modify( ld, dn, mods );