summaryrefslogtreecommitdiff
path: root/source4/dsdb/repl/drepl_service.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-04-23 00:43:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:51:30 -0500
commit023e2451873a89a433fadbe913b94507af856cf3 (patch)
tree069c97024aaf77573e588ace6cf641500d3f7f2b /source4/dsdb/repl/drepl_service.h
parent9ec83ae25df8e8e55ab1e25de4972ec4d082783b (diff)
downloadsamba-023e2451873a89a433fadbe913b94507af856cf3.tar.gz
samba-023e2451873a89a433fadbe913b94507af856cf3.tar.bz2
samba-023e2451873a89a433fadbe913b94507af856cf3.zip
r22472: Commit the start of the DRSUAPI pull replication service.
It doesn't work completely yet because we aren't able to resolve DNS SRV records. And also we also need a kdc locator plugin... But with some hacks the pull replication works fine metze (This used to be commit 0dc78f7439c9c786fd8c592960f9669dea40b811)
Diffstat (limited to 'source4/dsdb/repl/drepl_service.h')
-rw-r--r--source4/dsdb/repl/drepl_service.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/source4/dsdb/repl/drepl_service.h b/source4/dsdb/repl/drepl_service.h
index fb4fe2e500..bcbbd3038f 100644
--- a/source4/dsdb/repl/drepl_service.h
+++ b/source4/dsdb/repl/drepl_service.h
@@ -23,6 +23,91 @@
#ifndef _DSDB_REPL_DREPL_SERVICE_H_
#define _DSDB_REPL_DREPL_SERVICE_H_
+#include "librpc/gen_ndr/ndr_drsuapi_c.h"
+
+struct dreplsrv_service;
+struct dreplsrv_partition;
+
+struct dreplsrv_drsuapi_connection {
+ /*
+ * this pipe pointer is also the indicator
+ * for a valid connection
+ */
+ struct dcerpc_pipe *pipe;
+
+ DATA_BLOB gensec_skey;
+ struct drsuapi_DsBindInfo28 remote_info28;
+ struct policy_handle bind_handle;
+};
+
+struct dreplsrv_out_connection {
+ struct dreplsrv_out_connection *prev, *next;
+
+ struct dreplsrv_service *service;
+
+ /*
+ * the binding for the outgoing connection
+ */
+ struct dcerpc_binding *binding;
+
+ /* the out going connection to the source dsa */
+ struct dreplsrv_drsuapi_connection *drsuapi;
+};
+
+struct dreplsrv_partition_source_dsa {
+ struct dreplsrv_partition_source_dsa *prev, *next;
+
+ struct dreplsrv_partition *partition;
+
+ /*
+ * the cached repsFrom value for this source dsa
+ *
+ * it needs to be updated after each DsGetNCChanges() call
+ * to the source dsa
+ *
+ * repsFrom1 == &_repsFromBlob.ctr.ctr1
+ */
+ struct repsFromToBlob _repsFromBlob;
+ struct repsFromTo1 *repsFrom1;
+
+ /* the reference to the source_dsa and its outgoing connection */
+ struct dreplsrv_out_connection *conn;
+};
+
+struct dreplsrv_partition {
+ struct dreplsrv_partition *prev, *next;
+
+ struct dreplsrv_service *service;
+
+ /* the dn of the partition */
+ struct ldb_dn *dn;
+ struct drsuapi_DsReplicaObjectIdentifier nc;
+
+ /*
+ * uptodate vector needs to be updated before and after each DsGetNCChanges() call
+ *
+ * - before: we need to use our own invocationId together with our highestCommitedUsn
+ * - after: we need to merge in the remote uptodatevector, to avoid reading it again
+ */
+ struct replUpToDateVectorCtr2 uptodatevector;
+ struct drsuapi_DsReplicaCursorCtrEx uptodatevector_ex;
+
+ /*
+ * a linked list of all source dsa's we replicate from
+ */
+ struct dreplsrv_partition_source_dsa *sources;
+};
+
+struct dreplsrv_out_operation {
+ struct dreplsrv_out_operation *prev, *next;
+
+ struct dreplsrv_service *service;
+
+ struct dreplsrv_partition_source_dsa *source_dsa;
+
+ struct composite_context *creq;
+};
+
struct dreplsrv_service {
/* the whole drepl service is in one task */
struct task_server *task;
@@ -41,6 +126,14 @@ struct dreplsrv_service {
*/
struct ldb_context *samdb;
+ /* the guid of our NTDS Settings object, which never changes! */
+ struct GUID ntds_guid;
+ /*
+ * the struct holds the values used for outgoing DsBind() calls,
+ * so that we need to set them up only once
+ */
+ struct drsuapi_DsBindInfo28 bind_info28;
+
/* some stuff for periodic processing */
struct {
/*
@@ -58,8 +151,26 @@ struct dreplsrv_service {
struct timed_event *te;
} periodic;
+ /*
+ * the list of partitions we need to replicate
+ */
+ struct dreplsrv_partition *partitions;
+
+ /*
+ * the list of cached connections
+ */
+ struct dreplsrv_out_connection *connections;
+
+ struct {
+ /* the pointer to the current active operation */
+ struct dreplsrv_out_operation *current;
+
+ /* the list of pending operations */
+ struct dreplsrv_out_operation *pending;
+ } ops;
};
+#include "dsdb/repl/drepl_out_helpers.h"
#include "dsdb/repl/drepl_service_proto.h"
#endif /* _DSDB_REPL_DREPL_SERVICE_H_ */