From b954834ad1a60f006d0d391f17edbcaac9ed48f2 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Sat, 28 Aug 2010 20:00:39 +0300 Subject: s4-dreplsrv: Implement irpc stub to be used to force dreplsrv to update internal cache This IRPC calls is to be used whenever repsFrom/repsTo are changed by administrative tool or KCC (i.e. Topology changes). At present, only KCC may change topology. --- source4/dsdb/repl/drepl_service.c | 20 ++++++++++++++++++++ source4/librpc/idl/irpc.idl | 11 +++++++++++ 2 files changed, 31 insertions(+) (limited to 'source4') diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c index 652c16fda4..d118c45b6c 100644 --- a/source4/dsdb/repl/drepl_service.c +++ b/source4/dsdb/repl/drepl_service.c @@ -31,6 +31,7 @@ #include "librpc/gen_ndr/ndr_misc.h" #include "librpc/gen_ndr/ndr_drsuapi.h" #include "librpc/gen_ndr/ndr_drsblobs.h" +#include "librpc/gen_ndr/ndr_irpc.h" #include "param/param.h" static WERROR dreplsrv_init_creds(struct dreplsrv_service *service) @@ -127,6 +128,24 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg, return NT_STATUS_OK; } +/** + * Called when drplsrv should refresh its state. + * For example, when KCC change topology, dreplsrv + * should update its cache + * + * @param partition_dn If not empty/NULL, partition to update + */ +static NTSTATUS dreplsrv_refresh(struct irpc_message *msg, + struct dreplsrv_refresh *r) +{ + struct dreplsrv_service *s = talloc_get_type(msg->private_data, + struct dreplsrv_service); + + r->out.werr = dreplsrv_refresh_partitions(s); + + return NT_STATUS_OK; +} + /* startup the dsdb replicator service task */ @@ -214,6 +233,7 @@ static void dreplsrv_task_init(struct task_server *task) irpc_add_name(task->msg_ctx, "dreplsrv"); + IRPC_REGISTER(task->msg_ctx, irpc, DREPLSRV_REFRESH, dreplsrv_refresh, service); IRPC_REGISTER(task->msg_ctx, drsuapi, DRSUAPI_DSREPLICASYNC, drepl_replica_sync, service); messaging_register(task->msg_ctx, service, MSG_DREPL_ALLOCATE_RID, dreplsrv_allocate_rid); } diff --git a/source4/librpc/idl/irpc.idl b/source4/librpc/idl/irpc.idl index 03a931661e..220cecfb89 100644 --- a/source4/librpc/idl/irpc.idl +++ b/source4/librpc/idl/irpc.idl @@ -148,4 +148,15 @@ import "misc.idl", "security.idl", "nbt.idl"; [in] astring reason ); + /****************************************************** + management calls for the drepl server + ******************************************************/ + /** + * Force dreplsrv to fefresh internal cache. + * @param partition_dn Partition to refresh cacheh for. + * If empy/NULL, refresh all partitions. + */ + void dreplsrv_refresh( + [out] WERROR werr + ); } -- cgit