s4-dsdb: added new control DSDB_MODIFY_PARTIAL_REPLICA
[kai/samba-autobuild/.git] / source4 / dsdb / samdb / samdb.h
index ee42269000cfac791021b4df5338b1e514cddc7d..4c89f242472f1c5e3594b1eb05dddb7ad1705889 100644 (file)
@@ -30,15 +30,15 @@ struct loadparm_context;
 struct tevent_context;
 
 #include "librpc/gen_ndr/security.h"
-#include "lib/ldb/include/ldb.h"
+#include <ldb.h>
 #include "lib/ldb-samba/ldif_handlers.h"
 #include "librpc/gen_ndr/samr.h"
 #include "librpc/gen_ndr/drsuapi.h"
 #include "librpc/gen_ndr/drsblobs.h"
 #include "dsdb/schema/schema.h"
 #include "dsdb/samdb/samdb_proto.h"
-#include "dsdb/common/proto.h"
 #include "dsdb/common/dsdb_dn.h"
+#include "dsdb/common/proto.h"
 #include "../libds/common/flags.h"
 
 #define DSDB_CONTROL_CURRENT_PARTITION_OID "1.3.6.1.4.1.7165.4.3.2"
@@ -53,8 +53,19 @@ struct dsdb_control_current_partition {
        struct ldb_dn *dn;
 };
 
+
+/*
+  flags in dsdb_repl_flags to control replication logic
+ */
+#define DSDB_REPL_FLAG_PRIORITISE_INCOMING 1
+#define DSDB_REPL_FLAG_PARTIAL_REPLICA     2
+#define DSDB_REPL_FLAG_ADD_NCNAME         4
+
+
 #define DSDB_CONTROL_REPLICATED_UPDATE_OID "1.3.6.1.4.1.7165.4.3.3"
-/* DSDB_CONTROL_REPLICATED_UPDATE_OID has NULL data */
+struct dsdb_control_replicated_update {
+       uint32_t dsdb_repl_flags;
+};
 
 #define DSDB_CONTROL_DN_STORAGE_FORMAT_OID "1.3.6.1.4.1.7165.4.3.4"
 /* DSDB_CONTROL_DN_STORAGE_FORMAT_OID has NULL data and behaves very
@@ -80,7 +91,34 @@ struct dsdb_control_password_change_status {
 
 #define DSDB_CONTROL_PASSWORD_HASH_VALUES_OID "1.3.6.1.4.1.7165.4.3.9"
 
-#define DSDB_CONTROL_PASSWORD_CHANGE_OLD_PW_CHECKED_OID "1.3.6.1.4.1.7165.4.3.10"
+#define DSDB_CONTROL_PASSWORD_CHANGE_OID "1.3.6.1.4.1.7165.4.3.10"
+
+/* passed when we want to get the behaviour of the non-global catalog port */
+#define DSDB_CONTROL_NO_GLOBAL_CATALOG "1.3.6.1.4.1.7165.4.3.17"
+
+/* passed when we want special behaviour for partial replicas */
+#define DSDB_CONTROL_PARTIAL_REPLICA "1.3.6.1.4.1.7165.4.3.18"
+
+struct dsdb_control_password_change {
+       const struct samr_Password *old_nt_pwd_hash;
+       const struct samr_Password *old_lm_pwd_hash;
+};
+
+/**
+   DSDB_CONTROL_APPLY_LINKS is internal to Samba4 - a token passed between repl_meta_data and linked_attributes modules
+*/
+#define DSDB_CONTROL_APPLY_LINKS "1.3.6.1.4.1.7165.4.3.11"
+
+/*
+ * this should only be used for importing users from Samba3
+ */
+#define DSDB_CONTROL_BYPASS_PASSWORD_HASH_OID "1.3.6.1.4.1.7165.4.3.12"
+
+/**
+  OID used to allow the replacement of replPropertyMetaData.
+  It is used when the current replmetadata needs to be edited.
+*/
+#define DSDB_CONTROL_CHANGEREPLMETADATA_OID "1.3.6.1.4.1.7165.4.3.14"
 
 #define DSDB_EXTENDED_REPLICATED_OBJECTS_OID "1.3.6.1.4.1.7165.4.4.1"
 struct dsdb_extended_replicated_object {
@@ -95,9 +133,12 @@ struct dsdb_extended_replicated_objects {
         * this is the version of the dsdb_extended_replicated_objects
         * version 0: initial implementation
         */
-#define DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION 1
+#define DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION 2
        uint32_t version;
 
+       /* DSDB_REPL_FLAG_* flags */
+       uint32_t dsdb_repl_flags;
+
        struct ldb_dn *partition_dn;
 
        const struct repsFromTo1 *source_dsa;
@@ -110,16 +151,6 @@ struct dsdb_extended_replicated_objects {
        const struct drsuapi_DsReplicaLinkedAttribute *linked_attributes;
 };
 
-struct dsdb_naming_fsmo {
-       bool we_are_master;
-       struct ldb_dn *master_dn;
-};
-
-struct dsdb_pdc_fsmo {
-       bool we_are_master;
-       struct ldb_dn *master_dn;
-};
-
 #define DSDB_EXTENDED_CREATE_PARTITION_OID "1.3.6.1.4.1.7165.4.4.4"
 struct dsdb_create_partition_exop {
        struct ldb_dn *new_dn;
@@ -171,4 +202,5 @@ struct dsdb_fsmo_extended_op {
        struct GUID destination_dsa_guid;
 };
 
+#define DSDB_ACL_CHECKS_DIRSYNC_FLAG 0x1
 #endif /* __SAMDB_H__ */