From 7b4569214ed3c271c2876d2a955457d00d6d1381 Mon Sep 17 00:00:00 2001
From: Ludwig Krispenz <lkrispen@redhat.com>
Date: Mon, 8 Feb 2016 16:13:03 +0100
Subject: [PATCH] remove changelog4 and legacy consumer code

---
 Makefile.am                                        |  12 -
 Makefile.in                                        | 132 ----
 ldap/servers/plugins/replication/cl4.h             |  73 --
 ldap/servers/plugins/replication/cl4_api.c         | 804 ---------------------
 ldap/servers/plugins/replication/cl4_api.h         |  75 --
 ldap/servers/plugins/replication/cl4_init.c        | 357 ---------
 ldap/servers/plugins/replication/legacy_consumer.c | 701 ------------------
 ldap/servers/plugins/replication/repl.h            |  35 -
 ldap/servers/plugins/replication/repl5.h           |   1 -
 ldap/servers/plugins/replication/repl5_plugins.c   | 163 +----
 .../plugins/replication/repl5_protocol_util.c      |   9 -
 ldap/servers/plugins/replication/repl5_replica.c   | 168 +----
 .../plugins/replication/repl5_replica_config.c     |  29 +-
 ldap/servers/plugins/replication/repl_add.c        |  38 -
 ldap/servers/plugins/replication/repl_bind.c       |  58 --
 ldap/servers/plugins/replication/repl_compare.c    |  48 --
 ldap/servers/plugins/replication/repl_connext.c    |   1 -
 ldap/servers/plugins/replication/repl_delete.c     |  34 -
 ldap/servers/plugins/replication/repl_extop.c      |   7 -
 ldap/servers/plugins/replication/repl_init.c       | 302 --------
 ldap/servers/plugins/replication/repl_modify.c     |  37 -
 ldap/servers/plugins/replication/repl_modrdn.c     |  36 -
 ldap/servers/plugins/replication/repl_opext.c      |   5 -
 ldap/servers/plugins/replication/repl_ops.c        | 188 -----
 ldap/servers/plugins/replication/repl_rootdse.c    |   1 -
 ldap/servers/plugins/replication/repl_search.c     |  33 -
 26 files changed, 4 insertions(+), 3343 deletions(-)
 delete mode 100644 ldap/servers/plugins/replication/cl4.h
 delete mode 100644 ldap/servers/plugins/replication/cl4_api.c
 delete mode 100644 ldap/servers/plugins/replication/cl4_api.h
 delete mode 100644 ldap/servers/plugins/replication/cl4_init.c
 delete mode 100644 ldap/servers/plugins/replication/legacy_consumer.c
 delete mode 100644 ldap/servers/plugins/replication/repl_add.c
 delete mode 100644 ldap/servers/plugins/replication/repl_bind.c
 delete mode 100644 ldap/servers/plugins/replication/repl_compare.c
 delete mode 100644 ldap/servers/plugins/replication/repl_delete.c
 delete mode 100644 ldap/servers/plugins/replication/repl_init.c
 delete mode 100644 ldap/servers/plugins/replication/repl_modify.c
 delete mode 100644 ldap/servers/plugins/replication/repl_modrdn.c
 delete mode 100644 ldap/servers/plugins/replication/repl_ops.c
 delete mode 100644 ldap/servers/plugins/replication/repl_search.c

diff --git a/Makefile.am b/Makefile.am
index 9b19bd4..e5d0210 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -337,7 +337,6 @@ dist_noinst_HEADERS = \
 	ldap/servers/plugins/uiduniq/plugin-utils.h \
 	ldap/servers/plugins/memberof/memberof.h \
 	ldap/servers/plugins/replication/cl5_api.h \
-	ldap/servers/plugins/replication/cl4_api.h \
 	ldap/servers/plugins/replication/llist.h \
 	ldap/servers/plugins/replication/repl_shared.h \
 	ldap/servers/plugins/replication/csnpl.h \
@@ -351,7 +350,6 @@ dist_noinst_HEADERS = \
 	ldap/servers/plugins/replication/cl5_test.h \
 	ldap/servers/plugins/replication/repl5_ruv.h \
 	ldap/servers/plugins/replication/cl5_clcache.h \
-	ldap/servers/plugins/replication/cl4.h \
 	ldap/servers/plugins/replication/cl_crypt.h \
 	ldap/servers/plugins/replication/urp.h \
 	ldap/servers/plugins/replication/winsync-plugin.h \
@@ -1418,27 +1416,17 @@ libreplication_plugin_la_SOURCES = ldap/servers/plugins/replication/cl5_api.c \
 	ldap/servers/plugins/replication/cl5_init.c \
 	ldap/servers/plugins/replication/cl_crypt.c \
 	ldap/servers/plugins/replication/csnpl.c \
-	ldap/servers/plugins/replication/legacy_consumer.c \
 	ldap/servers/plugins/replication/llist.c \
-	ldap/servers/plugins/replication/repl_add.c \
-	ldap/servers/plugins/replication/repl_bind.c \
-	ldap/servers/plugins/replication/repl_compare.c \
 	ldap/servers/plugins/replication/repl_connext.c \
 	ldap/servers/plugins/replication/repl_controls.c \
-	ldap/servers/plugins/replication/repl_delete.c \
 	ldap/servers/plugins/replication/repl_entry.c \
 	ldap/servers/plugins/replication/repl_ext.c \
 	ldap/servers/plugins/replication/repl_extop.c \
 	ldap/servers/plugins/replication/repl_globals.c \
-	ldap/servers/plugins/replication/repl_init.c \
-	ldap/servers/plugins/replication/repl_modify.c \
-	ldap/servers/plugins/replication/repl_modrdn.c \
 	ldap/servers/plugins/replication/repl_monitor.c \
 	ldap/servers/plugins/replication/repl_objset.c \
 	ldap/servers/plugins/replication/repl_opext.c \
-	ldap/servers/plugins/replication/repl_ops.c \
 	ldap/servers/plugins/replication/repl_rootdse.c \
-	ldap/servers/plugins/replication/repl_search.c \
 	ldap/servers/plugins/replication/repl_session_plugin.c \
 	ldap/servers/plugins/replication/repl5_agmt.c \
 	ldap/servers/plugins/replication/repl5_agmtlist.c \
diff --git a/Makefile.in b/Makefile.in
index 87ba2f9..ac9f7bc 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -617,27 +617,17 @@ am_libreplication_plugin_la_OBJECTS = ldap/servers/plugins/replication/libreplic
 	ldap/servers/plugins/replication/libreplication_plugin_la-cl5_init.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-cl_crypt.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-csnpl.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-legacy_consumer.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-llist.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-repl_add.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-repl_bind.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-repl_compare.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_connext.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_controls.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-repl_delete.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_entry.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_ext.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_extop.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_globals.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-repl_init.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-repl_modify.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-repl_modrdn.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_monitor.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_objset.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_opext.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-repl_ops.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_rootdse.lo \
-	ldap/servers/plugins/replication/libreplication_plugin_la-repl_search.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl_session_plugin.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl5_agmt.lo \
 	ldap/servers/plugins/replication/libreplication_plugin_la-repl5_agmtlist.lo \
@@ -1762,7 +1752,6 @@ dist_noinst_HEADERS = \
 	ldap/servers/plugins/uiduniq/plugin-utils.h \
 	ldap/servers/plugins/memberof/memberof.h \
 	ldap/servers/plugins/replication/cl5_api.h \
-	ldap/servers/plugins/replication/cl4_api.h \
 	ldap/servers/plugins/replication/llist.h \
 	ldap/servers/plugins/replication/repl_shared.h \
 	ldap/servers/plugins/replication/csnpl.h \
@@ -1776,7 +1765,6 @@ dist_noinst_HEADERS = \
 	ldap/servers/plugins/replication/cl5_test.h \
 	ldap/servers/plugins/replication/repl5_ruv.h \
 	ldap/servers/plugins/replication/cl5_clcache.h \
-	ldap/servers/plugins/replication/cl4.h \
 	ldap/servers/plugins/replication/cl_crypt.h \
 	ldap/servers/plugins/replication/urp.h \
 	ldap/servers/plugins/replication/winsync-plugin.h \
@@ -2779,27 +2767,17 @@ libreplication_plugin_la_SOURCES = ldap/servers/plugins/replication/cl5_api.c \
 	ldap/servers/plugins/replication/cl5_init.c \
 	ldap/servers/plugins/replication/cl_crypt.c \
 	ldap/servers/plugins/replication/csnpl.c \
-	ldap/servers/plugins/replication/legacy_consumer.c \
 	ldap/servers/plugins/replication/llist.c \
-	ldap/servers/plugins/replication/repl_add.c \
-	ldap/servers/plugins/replication/repl_bind.c \
-	ldap/servers/plugins/replication/repl_compare.c \
 	ldap/servers/plugins/replication/repl_connext.c \
 	ldap/servers/plugins/replication/repl_controls.c \
-	ldap/servers/plugins/replication/repl_delete.c \
 	ldap/servers/plugins/replication/repl_entry.c \
 	ldap/servers/plugins/replication/repl_ext.c \
 	ldap/servers/plugins/replication/repl_extop.c \
 	ldap/servers/plugins/replication/repl_globals.c \
-	ldap/servers/plugins/replication/repl_init.c \
-	ldap/servers/plugins/replication/repl_modify.c \
-	ldap/servers/plugins/replication/repl_modrdn.c \
 	ldap/servers/plugins/replication/repl_monitor.c \
 	ldap/servers/plugins/replication/repl_objset.c \
 	ldap/servers/plugins/replication/repl_opext.c \
-	ldap/servers/plugins/replication/repl_ops.c \
 	ldap/servers/plugins/replication/repl_rootdse.c \
-	ldap/servers/plugins/replication/repl_search.c \
 	ldap/servers/plugins/replication/repl_session_plugin.c \
 	ldap/servers/plugins/replication/repl5_agmt.c \
 	ldap/servers/plugins/replication/repl5_agmtlist.c \
@@ -4267,30 +4245,15 @@ ldap/servers/plugins/replication/libreplication_plugin_la-cl_crypt.lo:  \
 ldap/servers/plugins/replication/libreplication_plugin_la-csnpl.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-legacy_consumer.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
 ldap/servers/plugins/replication/libreplication_plugin_la-llist.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_add.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_bind.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_compare.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_connext.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_controls.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_delete.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_entry.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
@@ -4303,15 +4266,6 @@ ldap/servers/plugins/replication/libreplication_plugin_la-repl_extop.lo:  \
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_globals.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_init.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_modify.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_modrdn.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_monitor.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
@@ -4321,15 +4275,9 @@ ldap/servers/plugins/replication/libreplication_plugin_la-repl_objset.lo:  \
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_opext.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_ops.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_rootdse.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_search.lo:  \
-	ldap/servers/plugins/replication/$(am__dirstamp) \
-	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_session_plugin.lo:  \
 	ldap/servers/plugins/replication/$(am__dirstamp) \
 	ldap/servers/plugins/replication/$(DEPDIR)/$(am__dirstamp)
@@ -5641,7 +5589,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-cl5_init.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-cl_crypt.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-csnpl.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-legacy_consumer.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-llist.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl5_agmt.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl5_agmtlist.Plo@am__quote@
@@ -5662,25 +5609,16 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl5_tot_protocol.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl5_total.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl5_updatedn_list.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_add.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_bind.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_compare.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_connext.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_controls.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_delete.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_entry.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_ext.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_extop.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_globals.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_init.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_modify.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_modrdn.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_monitor.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_objset.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_opext.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_ops.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_rootdse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_search.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_session_plugin.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-replutil.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-urp.Plo@am__quote@
@@ -7400,13 +7338,6 @@ ldap/servers/plugins/replication/libreplication_plugin_la-csnpl.lo: ldap/servers
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-csnpl.lo `test -f 'ldap/servers/plugins/replication/csnpl.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/csnpl.c
 
-ldap/servers/plugins/replication/libreplication_plugin_la-legacy_consumer.lo: ldap/servers/plugins/replication/legacy_consumer.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-legacy_consumer.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-legacy_consumer.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-legacy_consumer.lo `test -f 'ldap/servers/plugins/replication/legacy_consumer.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/legacy_consumer.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-legacy_consumer.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-legacy_consumer.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/legacy_consumer.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-legacy_consumer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-legacy_consumer.lo `test -f 'ldap/servers/plugins/replication/legacy_consumer.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/legacy_consumer.c
-
 ldap/servers/plugins/replication/libreplication_plugin_la-llist.lo: ldap/servers/plugins/replication/llist.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-llist.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-llist.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-llist.lo `test -f 'ldap/servers/plugins/replication/llist.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/llist.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-llist.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-llist.Plo
@@ -7414,27 +7345,6 @@ ldap/servers/plugins/replication/libreplication_plugin_la-llist.lo: ldap/servers
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-llist.lo `test -f 'ldap/servers/plugins/replication/llist.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/llist.c
 
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_add.lo: ldap/servers/plugins/replication/repl_add.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_add.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_add.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_add.lo `test -f 'ldap/servers/plugins/replication/repl_add.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_add.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_add.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_add.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/repl_add.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-repl_add.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_add.lo `test -f 'ldap/servers/plugins/replication/repl_add.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_add.c
-
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_bind.lo: ldap/servers/plugins/replication/repl_bind.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_bind.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_bind.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_bind.lo `test -f 'ldap/servers/plugins/replication/repl_bind.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_bind.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_bind.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_bind.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/repl_bind.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-repl_bind.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_bind.lo `test -f 'ldap/servers/plugins/replication/repl_bind.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_bind.c
-
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_compare.lo: ldap/servers/plugins/replication/repl_compare.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_compare.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_compare.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_compare.lo `test -f 'ldap/servers/plugins/replication/repl_compare.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_compare.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_compare.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_compare.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/repl_compare.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-repl_compare.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_compare.lo `test -f 'ldap/servers/plugins/replication/repl_compare.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_compare.c
-
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_connext.lo: ldap/servers/plugins/replication/repl_connext.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_connext.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_connext.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_connext.lo `test -f 'ldap/servers/plugins/replication/repl_connext.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_connext.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_connext.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_connext.Plo
@@ -7449,13 +7359,6 @@ ldap/servers/plugins/replication/libreplication_plugin_la-repl_controls.lo: ldap
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_controls.lo `test -f 'ldap/servers/plugins/replication/repl_controls.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_controls.c
 
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_delete.lo: ldap/servers/plugins/replication/repl_delete.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_delete.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_delete.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_delete.lo `test -f 'ldap/servers/plugins/replication/repl_delete.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_delete.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_delete.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_delete.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/repl_delete.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-repl_delete.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_delete.lo `test -f 'ldap/servers/plugins/replication/repl_delete.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_delete.c
-
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_entry.lo: ldap/servers/plugins/replication/repl_entry.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_entry.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_entry.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_entry.lo `test -f 'ldap/servers/plugins/replication/repl_entry.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_entry.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_entry.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_entry.Plo
@@ -7484,27 +7387,6 @@ ldap/servers/plugins/replication/libreplication_plugin_la-repl_globals.lo: ldap/
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_globals.lo `test -f 'ldap/servers/plugins/replication/repl_globals.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_globals.c
 
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_init.lo: ldap/servers/plugins/replication/repl_init.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_init.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_init.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_init.lo `test -f 'ldap/servers/plugins/replication/repl_init.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_init.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_init.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_init.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/repl_init.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-repl_init.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_init.lo `test -f 'ldap/servers/plugins/replication/repl_init.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_init.c
-
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_modify.lo: ldap/servers/plugins/replication/repl_modify.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_modify.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_modify.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_modify.lo `test -f 'ldap/servers/plugins/replication/repl_modify.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_modify.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_modify.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_modify.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/repl_modify.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-repl_modify.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_modify.lo `test -f 'ldap/servers/plugins/replication/repl_modify.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_modify.c
-
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_modrdn.lo: ldap/servers/plugins/replication/repl_modrdn.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_modrdn.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_modrdn.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_modrdn.lo `test -f 'ldap/servers/plugins/replication/repl_modrdn.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_modrdn.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_modrdn.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_modrdn.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/repl_modrdn.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-repl_modrdn.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_modrdn.lo `test -f 'ldap/servers/plugins/replication/repl_modrdn.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_modrdn.c
-
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_monitor.lo: ldap/servers/plugins/replication/repl_monitor.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_monitor.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_monitor.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_monitor.lo `test -f 'ldap/servers/plugins/replication/repl_monitor.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_monitor.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_monitor.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_monitor.Plo
@@ -7526,13 +7408,6 @@ ldap/servers/plugins/replication/libreplication_plugin_la-repl_opext.lo: ldap/se
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_opext.lo `test -f 'ldap/servers/plugins/replication/repl_opext.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_opext.c
 
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_ops.lo: ldap/servers/plugins/replication/repl_ops.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_ops.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_ops.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_ops.lo `test -f 'ldap/servers/plugins/replication/repl_ops.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_ops.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_ops.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_ops.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/repl_ops.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-repl_ops.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_ops.lo `test -f 'ldap/servers/plugins/replication/repl_ops.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_ops.c
-
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_rootdse.lo: ldap/servers/plugins/replication/repl_rootdse.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_rootdse.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_rootdse.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_rootdse.lo `test -f 'ldap/servers/plugins/replication/repl_rootdse.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_rootdse.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_rootdse.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_rootdse.Plo
@@ -7540,13 +7415,6 @@ ldap/servers/plugins/replication/libreplication_plugin_la-repl_rootdse.lo: ldap/
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_rootdse.lo `test -f 'ldap/servers/plugins/replication/repl_rootdse.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_rootdse.c
 
-ldap/servers/plugins/replication/libreplication_plugin_la-repl_search.lo: ldap/servers/plugins/replication/repl_search.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_search.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_search.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_search.lo `test -f 'ldap/servers/plugins/replication/repl_search.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_search.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_search.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_search.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ldap/servers/plugins/replication/repl_search.c' object='ldap/servers/plugins/replication/libreplication_plugin_la-repl_search.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_search.lo `test -f 'ldap/servers/plugins/replication/repl_search.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_search.c
-
 ldap/servers/plugins/replication/libreplication_plugin_la-repl_session_plugin.lo: ldap/servers/plugins/replication/repl_session_plugin.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreplication_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/replication/libreplication_plugin_la-repl_session_plugin.lo -MD -MP -MF ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_session_plugin.Tpo -c -o ldap/servers/plugins/replication/libreplication_plugin_la-repl_session_plugin.lo `test -f 'ldap/servers/plugins/replication/repl_session_plugin.c' || echo '$(srcdir)/'`ldap/servers/plugins/replication/repl_session_plugin.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_session_plugin.Tpo ldap/servers/plugins/replication/$(DEPDIR)/libreplication_plugin_la-repl_session_plugin.Plo
diff --git a/ldap/servers/plugins/replication/cl4.h b/ldap/servers/plugins/replication/cl4.h
deleted file mode 100644
index 3a2cf4e..0000000
--- a/ldap/servers/plugins/replication/cl4.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-/* cl4.h - global declarations used by the 4.0 style changelog module
- */
-
-#ifndef CL4_H
-#define CL4_H
-
-#include "slapi-private.h"
-#include "portable.h" /* GGOODREPL - is this cheating? */
-
-#define CONFIG_CHANGELOG_SUFFIX_ATTRIBUTE     "nsslapd-changelogsuffix"
-
-/* A place to store changelog config info */
-typedef struct _chglog4Info  chglog4Info;
-
-/* in cl4.c */	
-chglog4Info* changelog4_new (Slapi_Entry *e, char *errorbuf);
-void changelog4_free (chglog4Info** cl4);
-void changelog4_lock (Object *obj, PRBool write);
-void changelog4_unlock (Object *obj);
-const char * changelog4_get_dir (const chglog4Info* cl4);
-const char * changelog4_get_suffix (const chglog4Info* cl4);
-time_t changelog4_get_maxage (const chglog4Info* cl4);
-unsigned long changelog4_get_maxentries (const chglog4Info* cl4);
-void changelog4_set_dir (chglog4Info* cl4, const char *dir);
-void changelog4_set_suffix (chglog4Info* cl4, const char *suffix);
-void changelog4_set_maxage (chglog4Info* cl4, const char *maxage);
-void changelog4_set_maxentries (chglog4Info* cl4, const char* maxentries);
-
-/* In cl4_suffix.c */
-char *get_changelog_dataversion(const chglog4Info* cl4);
-void set_changelog_dataversion(chglog4Info* cl4, const char *dataversion);
-
-/* In cl4_config.c */
-int changelog4_config_init();
-void changelog4_config_destroy();
-
-/*
- * backend configuration information
- * Previously, these two typedefs were in ../../slapd/slapi-plugin.h but
- * the CL4 code is the only remaining code that references these definitions.
- */
-typedef struct config_directive
-{
-	char	*file_name;	/* file from which to read directive */
-	int		lineno;		/* line to read */
-	int		argc;		/* number of argvs */
-	char	**argv;		/* directive in agrv format */
-} slapi_config_directive;
-
-typedef struct be_config
-{
-	char					*type;		/* type of the backend   */
-	char					*suffix;	/* suffix of the backend */
-	int						is_private;	/* 1 - private, 0 -not   */
-	int						log_change;	/* 1 - write change to the changelog; 0 - don't */
-	slapi_config_directive	*directives;/* configuration directives */
-	int						dir_count;	/* number of directives */
-} slapi_be_config;
-  
-#endif
diff --git a/ldap/servers/plugins/replication/cl4_api.c b/ldap/servers/plugins/replication/cl4_api.c
deleted file mode 100644
index 069327d..0000000
--- a/ldap/servers/plugins/replication/cl4_api.c
+++ /dev/null
@@ -1,804 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-/* cl4_api.h - implementation of the minimal interface to 4.0 changelog necessary to 
-               link 4.0 changelog to 5.0 replication
- */
-
-#include "repl.h"
-#include "cl4_api.h"
-#include "csnpl.h"
-#include "cl4.h"
-
-/*** Data Structures ***/
-
-/* changelog internal data */
-typedef struct cl4priv
-{
-	CSNPL	*csnPL;				/* csn pending list */
-	int		regID;				/* csn function registration id */
-}CL4Private;
-
-/* callback data to get result of internal operations */
-typedef struct cl4ret
-{
-	int err;			/* error code	*/
-	Slapi_Entry *e;		/* target entry	*/
-}CL4Ret;
-
-/* Global Data */
-static CL4Private s_cl4Desc;	/* represents changelog state */
-
-/*** Helper functions forward declarations ***/
-static int _cl4WriteOperation (const slapi_operation_parameters *op); 
-static void _cl4AssignCSNCallback (const CSN *csn, void *data);
-static void _cl4AbortCSNCallback (const CSN *csn, void *data);
-static char* _cl4MakeCSNDN (const CSN* csn);
-static int _cl4GetEntry (const CSN *csn, Slapi_Entry **entry);
-static void _cl4ResultCallback (int err, void *callback_data);
-static int _cl4EntryCallback (Slapi_Entry *e, void *callback_data);
-static PRBool _cl4CanAssignChangeNumber (const CSN *csn);
-static int _cl4ResolveTargetDN (Slapi_Entry *entry, Slapi_DN **newTargetDN);
-static int _cl4GetTargetEntry (Slapi_DN *targetDN, const char *uniqueid, Slapi_Entry **entry);
-static int _cl4FindTargetDN (const CSN *csn, const char *uniqueid, 
-							 const Slapi_DN *targetSDN, Slapi_DN **newTargetDN);
-static int _cl4AssignChangeNumber (changeNumber *cnum);		
-static int _cl4UpdateEntry (const CSN *csn, const char *changeType, const Slapi_DN *newTargetDN, changeNumber cnum);
-
-/*** API ***/
-int cl4Init ()
-{
-	s_cl4Desc.csnPL = csnplNew ();
-	if (s_cl4Desc.csnPL == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cl4Init: failed to create CSN pending list\n");
-		return CL4_CSNPL_ERROR;
-	}
-
-	s_cl4Desc.regID = csnRegisterNewCSNCb(_cl4AssignCSNCallback, NULL,
-										  _cl4AbortCSNCallback, NULL);
-
-	return CL4_SUCCESS;
-}
-
-void cl4Cleanup ()
-{
-	if (s_cl4Desc.regID >= 0)
-	{
-		csnRemoveNewCSNCb(s_cl4Desc.regID);
-		s_cl4Desc.regID = -1;
-	}
-
-	if (s_cl4Desc.csnPL == NULL)
-		csnplFree (&s_cl4Desc.csnPL);
-}
-
-int cl4WriteOperation (const slapi_operation_parameters *op)
-{
-	int rc;
-	ReplicaId rd;
-
-	if (op == NULL || !IsValidOperation (op))
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cl4WriteEntry: invalid entry\n");
-		return CL4_BAD_DATA;
-	}
-	
-	rc = _cl4WriteOperation (op);	
-	if (rc != CL4_SUCCESS)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cl4WriteEntry: failed to write changelog entry\n");
-		return rc;
-	}
-
-	/* the entry is generated by this server - remove the entry from the pending list */
-	rd= csn_get_replicaid(op->csn);
-	if (rd == slapi_get_replicaid ())
-	{			
-		rc = csnplRemove (s_cl4Desc.csnPL, op->csn);
-
-		if (rc != 0)
-		{
-			slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-							"cl4WriteEntry: failed to remove CSN from the pending list\n");
-			rc = CL4_CSNPL_ERROR;
-		}
-	}
-
-	return rc;
-}
-
-int cl4ChangeTargetDN (const CSN *csn, const char *newDN)
-{
-	Slapi_PBlock *pb;
-	char *changeEntryDN;
-	Slapi_Mods smods;
-	int res;
-
-	if (csn == NULL || newDN == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cl4ChangeTargetDN: invalid argument\n");
-		return CL4_BAD_DATA;
-	}
-
-	/* construct dn of the change entry */
-	changeEntryDN = _cl4MakeCSNDN (csn);
-	if (changeEntryDN == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-						"cl4ChangeTargetDN: failed to construct change entry dn\n");
-		return CL4_MEMORY_ERROR;
-	}
-
-	pb = slapi_pblock_new ();
-
-	slapi_mods_init(&smods, 1);
-	slapi_mods_add(&smods, LDAP_MOD_REPLACE | LDAP_MOD_BVALUES, attr_targetdn, 
-				   strlen (newDN), newDN);
-	slapi_modify_internal_set_pb(pb, changeEntryDN, slapi_mods_get_ldapmods_byref(&smods), 
-								 NULL, NULL, repl_get_plugin_identity(PLUGIN_LEGACY_REPLICATION), 0);
-	slapi_modify_internal_pb (pb);
-
-	slapi_mods_done(&smods);
-	slapi_ch_free ((void**)&changeEntryDN);
-	
-	slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
-	slapi_pblock_destroy(pb);
-
-	if (res != LDAP_SUCCESS) 
-	{
-		char s[CSN_STRSIZE];
-	    slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name,
-	    "cl4ChangeTargetDN: an error occured while modifying change entry with csn %s: %s. "
-	    "Logging of changes is disabled.\n", csn_as_string(csn,PR_FALSE,s), ldap_err2string(res));
-	    /* GGOODREPL g_set_repl_backend( NULL ); */
-		return CL4_LDAP_ERROR;
-	}
-
-	return CL4_SUCCESS;                      
-}
-
-void cl4AssignChangeNumbers (time_t when, void *arg)
-{
-	int rc = CL4_SUCCESS;
-	Slapi_Entry *entry;
-	CSN *csn = NULL;
-	Slapi_DN *newTargetDN;
-	changeNumber cnum;
-	char *changetype;
-
-	/* we are looping though the entries ready to be commited updating there target dn
-	   and assigning change numbers */
-	while (_cl4GetEntry (csn, &entry) == CL4_SUCCESS)
-	{
-		/* ONREPL - I think we need to free previous csn */
-		csn = csn_new_by_string(slapi_entry_attr_get_charptr (entry, attr_csn));
-		/* all conflicts involving this entry have been resolved */
-		if (_cl4CanAssignChangeNumber (csn))
-		{
-			/* figure out the name of the target entry that corresponds to change csn */
-			rc = _cl4ResolveTargetDN (entry, &newTargetDN);
-			slapi_entry_free (entry);
-			if (rc != CL4_SUCCESS)
-			{
-				slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cl4AssignChangeNumbers: failed to resolve target dn\n");
-				break;
-			}
-
-			_cl4AssignChangeNumber (&cnum);	
-
-			changetype = slapi_entry_attr_get_charptr (entry, attr_changetype);	
-
-			/* update change entry: write change number and remove csn attribute.
-			   Note that we leave uniqueid in the entry to avoid an extra update.
-			   This is ok since uniqueid is an operational attribute not returned
-			   to the client by default. */
-			rc = _cl4UpdateEntry (csn, changetype, newTargetDN, cnum);
-			if (newTargetDN)
-			{
-				slapi_sdn_free (&newTargetDN);
-			}
-
-			slapi_ch_free ((void**)&changetype);
-
-			if (rc != CL4_SUCCESS)
-			{
-				slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-							    "cl4AssignChangeNumbers: failed to update changelog entry\n");
-				break;
-			}
-		}
-		else /* went too far */
-		{
-			slapi_entry_free (entry);
-			break;
-		}		
-	}
-}
-
-
-/*** Helper Functions ***/
-
-/* adds new change record to 4.0 changelog */
-static int _cl4WriteOperation (const slapi_operation_parameters *op)
-{
-	int rc = CL4_SUCCESS, res;
-    char *changeEntryDN, *timeStr;
-    Slapi_Entry		*e = NULL;
-    Slapi_PBlock	*pb = NULL;
-	Slapi_Value     *values[3];
-	char s[CSN_STRSIZE];
-   
-    slapi_log_error (SLAPI_LOG_PLUGIN, repl_plugin_name,
-	    "_cl4WriteEntry: writing change record with csn %s for dn: \"%s\"\n", 
-	    csn_as_string(op->csn,PR_FALSE,s), op->target_address.dn);
-
-	/* create change entry dn */ 
-	changeEntryDN = _cl4MakeCSNDN (op->csn);
-	if (changeEntryDN == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-						"_cl4WriteEntry: failed to create entry dn\n");
-		return CL4_MEMORY_ERROR;
-	}
-
-    /*
-     * Create the entry struct, and fill in fields common to all types
-     * of change records.
-     */
-    e = slapi_entry_alloc();
-	if (e == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-						"_cl4WriteEntry: failed to allocate change entry\n");
-		return CL4_MEMORY_ERROR;
-	}
-
-    slapi_entry_set_dn(e, slapi_ch_strdup (changeEntryDN));
-
-    /* Set the objectclass attribute */
-	values [0] = slapi_value_new (NULL);
-	values [1] = slapi_value_new (NULL);
-	values [2] = NULL;
-    slapi_value_set_string(values[0], "top");
-	slapi_value_set_string(values[1], "changelogentry");
-    slapi_entry_add_values_sv (e, "objectclass", values);
-
-	/* ONREPL - for now we have to free Slapi_Values since api makes copy;
-				this will change when a new set of api is added */
-	slapi_value_free (&(values[0]));				
-	slapi_value_free (&(values[1]));				
-
-    /* Set the changeNumber attribute */
-	/* Need to set this because it is required by schema */
-    slapi_entry_attr_set_charptr (e, attr_changenumber, "0");
-
-    /* Set the targetentrydn attribute */
-	if (op->operation_type == SLAPI_OPERATION_ADD) /* use raw dn */
-		slapi_entry_attr_set_charptr (e, attr_targetdn, slapi_entry_get_dn (op->p.p_add.target_entry));		
-	else /* use normolized dn */
-		slapi_entry_attr_set_charptr (e, attr_targetdn, op->target_address.dn);
-
-	/* ONREPL - set dbid attribute */		
-
-    /* Set the changeTime attribute */
-    timeStr = format_localTime (current_time());
-    slapi_entry_attr_set_charptr (e, attr_changetime, timeStr);
-    slapi_ch_free((void**)&timeStr);
-
-    /*
-     * Finish constructing the entry.  How to do it depends on the type
-     * of modification being logged.
-     */
-    switch (op->operation_type) 
-	{
-		case SLAPI_OPERATION_ADD:	if (entry2reple(e, op->p.p_add.target_entry) != 0 ) 
-									{
-										rc = CL4_INTERNAL_ERROR;
-										goto done;
-									}
-
-									break;
-
-		case SLAPI_OPERATION_MODIFY: if (mods2reple(e, op->p.p_modify.modify_mods) != 0) 
-									 {
-										rc = CL4_INTERNAL_ERROR;
-										goto done;
-									 }
-
-									 break;
-
-		case SLAPI_OPERATION_MODDN:	if (modrdn2reple(e, op->p.p_modrdn.modrdn_newrdn, 
-									    op->p.p_modrdn.modrdn_deloldrdn, op->p.p_modrdn.modrdn_mods) != 0) 
-									{
-										rc = CL4_INTERNAL_ERROR;
-										goto done;
-									}
-
-									break;
-
-		case SLAPI_OPERATION_DELETE: /* Set the changetype attribute */
-									 slapi_entry_attr_set_charptr (e, attr_changetype, "delete");
-									 break;
-    }
-
-	pb = slapi_pblock_new (pb);
-	slapi_add_entry_internal_set_pb (pb, e, NULL, repl_get_plugin_identity (PLUGIN_LEGACY_REPLICATION), 0);
-	slapi_add_internal_pb (pb);
-	e = NULL; /* add consumes entry */
-		
-	slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
-	slapi_pblock_destroy(pb);
-	
-	if (res != LDAP_SUCCESS) 
-	{
-		char s[CSN_STRSIZE];
-	    slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name,
-			"_cl4WriteEntry: an error occured while adding change entry with csn %s, dn = %s: %s. "
-			"Logging of changes is disabled.\n", csn_as_string(op->csn,PR_FALSE,s), op->target_address.dn, 
-			ldap_err2string(res));
-	    /* GGOODREPL g_set_repl_backend( NULL ); */
-		rc = CL4_LDAP_ERROR;
-	}
- 
-done:
-	slapi_entry_free(e);
-	if (changeEntryDN)   
-		slapi_ch_free((void **) &changeEntryDN);
-
-	return rc;
-}
-
-static void _cl4AssignCSNCallback (const CSN *csn, void *data)
-{
-	int rc;
-
-	if (csn == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4AssignCSNCallback: null csn\n");
-		return;
-	}
-
-	rc = csnplInsert (s_cl4Desc.csnPL, csn);
-
-	if (rc == -1)
-	{
-		char s[CSN_STRSIZE];
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-				"_cl4AssignCSNCallback: failed to insert csn %s to the pending list\n",
-				csn_as_string(csn,PR_FALSE,s));
-	}
-}
-
-static void _cl4AbortCSNCallback (const CSN *csn, void *data)
-{
-	int rc;
-
-	if (csn == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4AbortCSNCallback: null csn\n");
-		return;
-	}
-
-	rc = csnplRemove (s_cl4Desc.csnPL, csn);
-	if (rc == -1)
-	{
-		char s[CSN_STRSIZE];
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-				"_cl4AbortCSNCallback: failed to remove csn %s from the pending list\n",
-				csn_as_string(csn,PR_FALSE,s));		
-	}
-}
-
-/* initial dn format: csn=<csn>,<changelog suffix>. For instance, csn=013744022939465,cn=changelog4 */
-static char* _cl4MakeCSNDN (const CSN* csn)
-{
-	char *pat, *edn;
-	char *suffix = changelog4_get_suffix ();
-	char s[CSN_STRSIZE];
-
-	if (suffix == NULL)
-		return NULL;
-
-	/* Construct the dn of this change record */
-    edn = slapi_ch_smprintf("%s=%s,%s", attr_csn, csn_as_string(csn,PR_FALSE,s), suffix);
-	slapi_ch_free ((void **)&suffix);
-
-	return edn;
-}
-
-static int _cl4GetEntry (const CSN *csn, Slapi_Entry **entry)
-{
-	int rc;
-	char *suffix = changelog4_get_suffix ();
-	int type;
-	const char *value;
-	CL4Ret ret;
-	char s[CSN_STRSIZE];		
-
-	if (csn == NULL)	/* entry with smallest csn */
-	{
-		type = SLAPI_SEQ_FIRST;	
-		value = NULL;
-	}
-	else /* entry with next csn */
-	{
-		type = SLAPI_SEQ_NEXT;	
-		value = csn_as_string(csn,PR_FALSE,s);
-	}
-
-	rc = slapi_seq_callback(suffix, type, attr_csn, (char*)value, NULL, 0, &ret, NULL,
-							_cl4ResultCallback, _cl4EntryCallback, NULL);
-	slapi_ch_free ((void**)&suffix);
-
-	if (rc != 0 || ret.err != 0)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4GetEntry: failed to get next changelog entry\n");
-		return CL4_INTERNAL_ERROR;
-	}
-
-	*entry = ret.e;
-	return CL4_SUCCESS;                   	
-}
-
-static void _cl4ResultCallback (int err, void *callback_data)
-{
-	CL4Ret *ret = (CL4Ret *)callback_data;
-
-	if (ret)
-	{
-		ret->err = err;
-	}	
-}
-
-static int _cl4EntryCallback (Slapi_Entry *e, void *callback_data)
-{
-	CL4Ret *ret = (CL4Ret *)callback_data;
-
-	if (ret)
-	{
-		ret->e = slapi_entry_dup (e);
-	}
-
-	return 0;	
-}
-
-static PRBool _cl4CanAssignChangeNumber (const CSN *csn)
-{
-	CSN *commitCSN = NULL;
-
-	/* th CSN is withtin region that can be commited */
-	if (csn && csn_compare(csn, commitCSN) < 0)
-		return PR_TRUE;
-
-	return PR_FALSE;
-}
-
-/* ONREPL - describe algorithm */
-static int _cl4ResolveTargetDN (Slapi_Entry *entry, Slapi_DN **newTargetDN)
-{
-	int rc;
-	char *csnStr = slapi_entry_attr_get_charptr (entry, attr_csn);
-	char *targetdn = slapi_entry_attr_get_charptr (entry, attr_targetdn);
-	const char *uniqueid = slapi_entry_get_uniqueid (entry);
-	char *changetype = slapi_entry_attr_get_charptr (entry, attr_changetype);
-	CSN *csn = csn_new_by_string (csnStr);
-	Slapi_Entry *targetEntry = NULL;
-	const Slapi_DN *teSDN;
-	Slapi_DN *targetSDN;
-	const CSN *teDNCSN = NULL;
-	
-	*newTargetDN = NULL;
-
-	targetSDN = slapi_sdn_new();
-	if (strcasecmp (changetype, "add") == 0) /* this is add operation - we have rawdn */
-		slapi_sdn_set_dn_byref (targetSDN, targetdn);	
-	else
-		slapi_sdn_set_normdn_byref (targetSDN, targetdn);
-
-	/* read the entry to which the change was applied */
-	rc = _cl4GetTargetEntry (targetSDN, uniqueid, &targetEntry);
-	if (rc != CL4_SUCCESS)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4ResolveTargetDN: failed to get target entry\n");
-		goto done;
-	}
-
-	teDNCSN = entry_get_dncsn(targetEntry);
-	if (teDNCSN == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4ResolveTargetDN: failed to get target entry dn\n");
-		rc = CL4_BAD_FORMAT;
-		goto done;
-	}
-	
-	if (csn_compare(teDNCSN, csn) <= 0)
-	{
-		/* the change entry target dn should be the same as target entry dn */
-		teSDN = slapi_entry_get_sdn_const(targetEntry);
-
-		/* target dn of change entry is not the same as dn of the target entry - update */
-		if (slapi_sdn_compare (teSDN, targetSDN) != 0)
-		{
-			*newTargetDN = slapi_sdn_dup (targetSDN);	
-		}
-	}
-	else /* the target entry was renamed since this change occur - find the right target dn */
-	{
-		rc = _cl4FindTargetDN (csn, uniqueid, targetSDN, newTargetDN);
-	}
-
-done:;
-	if (csnStr)
-		slapi_ch_free ((void**)&csnStr);
-	
-	if (targetdn)
-		slapi_ch_free ((void**)&targetdn);		
-
-	if (uniqueid)
-		slapi_ch_free ((void**)&uniqueid);
-
-	if (changetype)
-		slapi_ch_free ((void**)&changetype);
-	
-	if (targetEntry)
-		slapi_entry_free (targetEntry);
-
-	if (targetSDN)
-		slapi_sdn_free (&targetSDN);
-
-	return rc;
-}
-
-static int _cl4GetTargetEntry (Slapi_DN *sdn, const char *uniqueid, Slapi_Entry **entry)
-{
-	Slapi_PBlock *pb;
-	char filter [128];
-	int res, rc = CL4_SUCCESS;
-	Slapi_Entry **entries = NULL;
-
-	/* read corresponding database entry based on its uniqueid */
-	PR_snprintf (filter, sizeof(filter), "uniqueid=%s", uniqueid);	
-	pb = slapi_pblock_new ();
-	slapi_search_internal_set_pb (pb, (char*)slapi_sdn_get_ndn(sdn), LDAP_SCOPE_SUBTREE, filter, NULL, 0, NULL, NULL,
-								  repl_get_plugin_identity (PLUGIN_LEGACY_REPLICATION), 0);
-	slapi_search_internal_pb (pb);
-
-	if (pb == NULL)
-	{
-		rc = CL4_LDAP_ERROR;
-		goto done;
-	}
-
-	slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
-	if (res == LDAP_NO_SUCH_OBJECT)	/* entry not found */
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4GetTargetEntry: entry (%s) not found\n", 
-						slapi_sdn_get_ndn(sdn));
-		rc = CL4_NOT_FOUND;
-		goto done;
-	}
-
-	if (res != LDAP_SUCCESS) 
-	{
-	    slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name,
-	    "_cl4ResolveTargetDN: an error occured while searching for directory entry with uniqueid %s: %s. "
-	    "Logging of changes is disabled.\n", uniqueid, ldap_err2string(res));
-	    /* GGOODREPL g_set_repl_backend( NULL ); */
-		rc = CL4_LDAP_ERROR;
-		goto done;
-	}
-	
-    slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
-	if (entries == NULL || entries [0] == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4GetTargetEntry: entry (%s) not found\n", 
-						slapi_sdn_get_ndn(sdn));
-		rc = CL4_NOT_FOUND;
-		goto done;	
-	}
-
-	*entry = slapi_entry_dup (entries[0]);
-
-done:
-	if (pb)
-	{
-		slapi_free_search_results_internal(pb);
-		slapi_pblock_destroy (pb);
-	}
-	
-	return rc;
-}
-
-static int _cl4FindTargetDN (const CSN *csn, const char *uniqueid, 
-							 const Slapi_DN *targetSDN, Slapi_DN **newTargetDN)
-{
-	int rc = CL4_SUCCESS;
-	int res, i;
-	Slapi_PBlock *pb;
-	char *suffix = changelog4_get_suffix ();
-	char filter [128];
-	Slapi_Entry **entries;
-	int minIndex = 0;
-	CSN *minCSN = NULL, *curCSN;
-	char *curType;	
-	const Slapi_DN	*sdn;
-	char s[CSN_STRSIZE];		
-
-	*newTargetDN = NULL;
-
-	/* Look for all modifications to the target entry with csn larger than 
-	   this csn. We are only interested in rename operations, but change type
-       is currently not indexed */
-	PR_snprintf (filter, 128, "&(uniqueid=%s)(csn>%s)", uniqueid, csn_as_string(csn,PR_FALSE,s));
-	pb = slapi_pblock_new ();
-	slapi_search_internal_set_pb (pb, suffix, LDAP_SCOPE_SUBTREE, filter, NULL, 0, NULL, NULL,
-								  repl_get_plugin_identity (PLUGIN_LEGACY_REPLICATION), 0);
-	slapi_search_internal_pb (pb);
-	slapi_ch_free ((void**)&suffix);
-	if (pb == NULL)
-	{
-		rc = CL4_LDAP_ERROR;
-		goto done;
-	}
-
-	slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
-	if (res == LDAP_NO_SUCH_OBJECT)	/* entry not found */
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4FindTargetDN: no entries much filter (%s)\n",
-						filter);
-		rc = CL4_NOT_FOUND;
-		goto done;
-	}
-
-	if (res != LDAP_SUCCESS) 
-	{
-	    slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name,
-	    "_cl4ResolveTargetDN: an error occured while searching change entries matching filter %s: %s. "
-	    "Logging of changes is disabled.\n", filter, ldap_err2string(res));
-	    /* GGOODREPL g_set_repl_backend( NULL ); */
-		rc = CL4_LDAP_ERROR;
-		goto done;
-	}
-
-	slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
-	if (entries == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4FindTargetDN: no entries much filter (%s)\n",
-						filter);
-		rc = CL4_NOT_FOUND;
-		goto done;	
-	}
-
-	i = 0;
-
-	/* find rename operation with smallest csn - its target dn should be the name
-	   of our change entry */
-	while (entries[i])
-	{
-		curType = slapi_entry_attr_get_charptr (entries[i], attr_changetype);
-		if (curType && strcasecmp (curType, "modrdn") == 0)
-		{
-			curCSN = csn_new_by_string (slapi_entry_attr_get_charptr (entries[i], attr_csn));
-			if (minCSN == NULL || csn_compare (curCSN, minCSN) < 0)
-			{
-				minCSN = curCSN;
-				minIndex = i;
-			}
-		}
-
-		if (curType)
-			slapi_ch_free ((void**)&curType);
-		
-		i ++;
-	}
-
-	if (curCSN == NULL)
-	{
-		rc = CL4_NOT_FOUND;
-		goto done;
-	}
-
-	/* update targetDN of our entry if necessary */
-	sdn = slapi_entry_get_sdn_const(entries[minIndex]);
-
-	/* target dn does not match to renaming operation - rename change entry */
-	if (slapi_sdn_compare (sdn, targetSDN) != 0)
-		*newTargetDN = slapi_sdn_dup (sdn);
-
-done:
-	if (pb)
-	{
-		slapi_free_search_results_internal(pb);
-		slapi_pblock_destroy (pb);
-	}
-	
-	return rc;
-}
-
-static int _cl4AssignChangeNumber (changeNumber *cnum)
-{
-	*cnum = ldapi_assign_changenumber();
-	return CL4_SUCCESS;
-}
-
-static int _cl4UpdateEntry (const CSN *csn, const char *changeType, 
-						    const Slapi_DN *newDN, changeNumber cnum)
-{	 
-	Slapi_PBlock *pb;
-	char *dn;
-	const char *dnTemp;
-	int res;
-	Slapi_Mods smods;
-	char cnumbuf[32];
-
-	if (csn == NULL || changeType == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4UpdateEntry: invalid argument\n");
-		return CL4_BAD_DATA;
-	}
-
-	dn = _cl4MakeCSNDN (csn);
-	if (dn == NULL)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_cl4UpdateEntry: failed to create entry dn\n");
-		return CL4_MEMORY_ERROR;
-	}
-
-	slapi_mods_init(&smods, 2);
-	if (newDN)
-	{
-		if (strcasecmp (changeType, "add") == 0)
-			dnTemp = slapi_sdn_get_dn (newDN);
-		else
-			dnTemp = slapi_sdn_get_ndn (newDN);
-			
-		slapi_mods_add(&smods, LDAP_MOD_REPLACE | LDAP_MOD_BVALUES, attr_targetdn, 
-					   strlen (dnTemp), dnTemp);
-	}
-	/* Set the changeNumber attribute */
-    sprintf(cnumbuf, "%lu", cnum);
-    slapi_mods_add (&smods, LDAP_MOD_REPLACE | LDAP_MOD_BVALUES, attr_changenumber,
-					strlen (cnumbuf), cnumbuf);		 
-	pb = slapi_pblock_new ();
-	slapi_modify_internal_set_pb (pb, dn, slapi_mods_get_ldapmods_byref(&smods), NULL, NULL, 
-								  repl_get_plugin_identity (PLUGIN_LEGACY_REPLICATION), 0);
-	slapi_modify_internal_pb (pb);
-	slapi_mods_done(&smods);	
-	slapi_ch_free ((void**)&dn);
-
-	if (pb == NULL)
-	{
-		return CL4_LDAP_ERROR;
-	}
-	
-	slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
-	slapi_pblock_destroy(pb);
-	if (res != LDAP_SUCCESS) 
-	{
-		char s[CSN_STRSIZE];		
-	    slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name,
-	    "cl4ChangeTargetDN: an error occured while modifying change entry with csn %s: %s. "
-	    "Logging of changes is disabled.\n", csn_as_string(csn,PR_FALSE,s), ldap_err2string(res));
-	    /* GGOODREPL g_set_repl_backend( NULL ); */
-		return CL4_LDAP_ERROR;
-	}
-
-	if ( ldapi_get_first_changenumber() == (changeNumber) 0L ) 
-	{
-		ldapi_set_first_changenumber( cnum );
-	}
-
-	ldapi_commit_changenumber(cnum);
-	return CL4_SUCCESS;	
-}
diff --git a/ldap/servers/plugins/replication/cl4_api.h b/ldap/servers/plugins/replication/cl4_api.h
deleted file mode 100644
index e5812c6..0000000
--- a/ldap/servers/plugins/replication/cl4_api.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-/* cl4_api.h - minimal interface to 4.0 changelog necessary to link 4.0 changelog
-			   to 5.0 replication
- */
-
-#ifndef CL4_API_H
-#define CL4_API_H
-
-#include "repl.h"
-
-/*** Error Codes ***/
-enum
-{
-	CL4_SUCCESS,
-	CL4_BAD_DATA,
-	CL4_BAD_FORMAT,
-	CL4_NOT_FOUND,
-	CL4_MEMORY_ERROR,
-	CL4_CSNPL_ERROR,
-	CL4_LDAP_ERROR,
-	CL4_INTERNAL_ERROR
-};
-
-/*** APIs ***/
-/*	Name:			cl4Init
-	Description:	initializes 4.0 changelog subsystem
-	Parameters:		none
-	Return:			????
- */
-int cl4Init ();
-
-/*	Name:			cl4WriteOperation
-	Description:	logs operation to 4.0 changelog; operation must go through CD&R engine first
-	Parameters:		op - operation to be logged
-					
-	Return:			????
- */
-int cl4WriteOperation (const slapi_operation_parameters *op);
-
-/*	Name:			cl4ChangeTargetDN
-	Description:	modifies change entry target dn; should be called for conflicts due to naming collisions;
-					raw dn should be passed for add operations; normolized dn otherwise.
-	Parameters:		csn - csn of the change entry to be modified
-					newDN - new target dn of the entry
-	Return:			????
- */
-int cl4ChangeTargetDN (const CSN* csn, const char *newDN);
-
-/*	Name:			cl4AssignChangeNumbers
-	Description:	this function should be called periodically to assign change numbers to changelog
-					entries. Intended for use with event queue
-	Parameters:		parameters are not currently used
-	Return:			none
- */
-void cl4AssignChangeNumbers (time_t when, void *arg);
-
-/*	Name:			cl4Cleanup
-	Description:	frees memory held by 4.0 changelog subsystem
-	Parameters:		none
-	Return:			none
- */
-void cl4Clean ();
-#endif
diff --git a/ldap/servers/plugins/replication/cl4_init.c b/ldap/servers/plugins/replication/cl4_init.c
deleted file mode 100644
index 4ae0315..0000000
--- a/ldap/servers/plugins/replication/cl4_init.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-
-/* cl4_init.c - implments initialization/cleanup functions for 
-                4.0 style changelog
- */
-
-#include <string.h>
-
-#include "slapi-plugin.h"
-#include "cl4.h"
-#include "repl.h"
-
-/* forward declarations */
-static int changelog4_create_be();
-static int changelog4_start_be ();
-static int changelog4_close();
-static int changelog4_remove();
-
-/*
- * Initialise the 4.0 Changelog
- */
-int changelog4_init ()
-{
-    int rc= 0; /* OK */
-    Slapi_Backend *rbe;
-	changeNumber first_change = 0UL, last_change = 0UL;
-	int lderr;
-	
-    if (changelog4_create_be() < 0 )
-	{
-		rc= -1;
-	}
-	else
-	{
-	rc = changelog4_start_be ();
-	}
-
-    if(rc == 0)
-	{
-        rbe = get_repl_backend();
-    	if(rbe!=NULL)
-    	{
-    	    /* We have a Change Log. Check it's valid. */
-			/* changelog has to be started before its 
-			   data version can be read */ 
-            const char *sdv= get_server_dataversion();
-    	    const char *cdv= get_changelog_dataversion();
-			char *suffix = changelog4_get_suffix ();
-			if(!cdv || strcmp(sdv,cdv)!=0)
-			{
-				
-			    /* The SDV and CDV are not the same.  The Change Log is invalid. 
-			       It must be removed. */
-				/* ONREPL - currently we go through this code when the changelog
-				   is first created because we can't tell new backend from the
-				   existing one.*/
-				rc	= changelog4_close();
-				rc	= changelog4_remove();
-
-				/* now restart the changelog */
-				changelog4_start_be ();
-
-				create_entity( suffix, "extensibleobject");
-                /* Write the Server Data Version onto the changelog suffix entry */
-                /* JCMREPL - And the changelog database version number */
-                set_changelog_dataversion(sdv);
-				slapi_ch_free ((void **)&suffix);
-
-			}
-		}
-	}
-    
-	if(rc != 0)
-	{
-		slapi_log_error( SLAPI_LOG_PLUGIN, repl_plugin_name, 
-						"An error occurred configuring the changelog database\n" );
-    }
-
-	first_change = replog_get_firstchangenum( &lderr );
-	last_change = replog_get_lastchangenum( &lderr );
-	ldapi_initialize_changenumbers( first_change, last_change );
-
-    return rc;
-}
-
-static int
-
-changelog4_close()
-{
-	int rc= 0 /* OK */;
-    Slapi_Backend *rbe= get_repl_backend();
-	Slapi_PBlock *pb = slapi_pblock_new ();	
-	IFP closefn = NULL;
-
-	rc = slapi_be_getentrypoint (rbe, SLAPI_PLUGIN_CLOSE_FN, (void**)&closefn, pb);
-	if (rc != 0)
-	{
-		slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, 
-						"Error: backend close entry point is missing. "
-                        "Replication subsystem disabled.\n");
-		slapi_pblock_destroy (pb);
-		set_repl_backend( NULL );
-		return -1;
-	}
-
-	rc = closefn (pb);
-
-	if (rc != 0)
-	{
-		
-		slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, "Error: the changelog database could "
-    		"not be closed.  Replication subsystem disabled.\n");
-		set_repl_backend( NULL );
-		rc = -1;
-	}
-
-	slapi_pblock_destroy (pb);
-	return rc;
-
-}
-
-static int
-changelog4_remove()
-{
-    int rc= 0 /* OK */;
-    Slapi_Backend *rbe= get_repl_backend();
-	Slapi_PBlock *pb = slapi_pblock_new ();	
-	IFP rmdbfn = NULL;
-
-	rc = slapi_be_getentrypoint (rbe, SLAPI_PLUGIN_DB_RMDB_FN, (void**)&rmdbfn, pb);
-	if (rc != 0)
-	{
-		slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, 
-						"Error: backend rmdb entry point is missing. "
-                        "Replication subsystem disabled.\n");
-		slapi_pblock_destroy (pb);
-		set_repl_backend( NULL );
-		return -1;
-	}
-
-	rc = rmdbfn (pb);
-
-	if (rc != 0)
-	{
-		
-		slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, "Error: the changelog database could "
-    		"not be removed.  Replication subsystem disabled.\n");
-		rc = -1;
-	}
-	else
-	{
-    	slapi_log_error( SLAPI_LOG_REPL, repl_plugin_name, "New database generation computed. "
-    		"Changelog database removed.\n");
-	}
-
-	slapi_pblock_destroy (pb);
-	return rc;
-}
-
-static Slapi_Backend *repl_backend = NULL;
-
-Slapi_Backend
-*get_repl_backend()
-{
-	return repl_backend;
-}
-
-void
-set_repl_backend(Slapi_Backend *be)
-{
-	repl_backend = be;
-}
-
-
-int changelog4_shutdown ()
-{
-	/* ONREPL - will shutdown the backend */
-	int rc = 1;
-
-	return rc;
-}
-
-static void changelog4_init_trimming ()
-{
-	char *cl_maxage = changelog4_get_maxage ();
-	unsigned long cl_maxentries = changelog4_get_maxentries ();
-	time_t ageval = slapi_parse_duration(cl_maxage);
-	
-	slapi_ch_free ((void **)&cl_maxage);
-
-    init_changelog_trimming(cl_maxentries, ageval );
-}
-
-
-
-/*
- * Function: changelog4_create_be
- * Arguments: none
- * Returns: 0 on success, non-0 on error
- * Description: configures changelog backend instance.  
- */
-
-static int
-changelog4_create_be()
-{
-	int i, dir_count = 5;
-    Slapi_Backend *rbe;
-	slapi_be_config config;
-	char *cl_dir = changelog4_get_dir ();
-	char *cl_suffix;
-
-    if ( cl_dir == NULL ) {
-		slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, 
-						"Error: no directory specified for changelog database.\n");
-        return -1;
-    }
-	
-	cl_suffix = changelog4_get_suffix ();
-
-    if ( cl_suffix == NULL ) {
-		slapi_ch_free ((void **)&cl_dir);
-		slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, 
-						"Error: no suffix specified for changelog database.\n");
-        return -1;
-    }
-
-	/* setup configuration parameters for backend initialization */   
-	config.type			= CHANGELOG_LDBM_TYPE;
-	config.suffix		= cl_suffix;
-	config.is_private	= 1;	/* yes */ 
-	config.log_change	= 0;	/* no */
-	config.directives = (slapi_config_directive*)slapi_ch_calloc(
-                         dir_count, sizeof(slapi_config_directive));
-    config.dir_count  = dir_count;
-
-	for (i = 0; i < dir_count; i++)
-	{
-		config.directives[i].file_name = "(internal)";
-		config.directives[i].lineno	= 0;	
-	}
-
-	/* setup indexes */
-	config.directives[0].argv = NULL;
-	config.directives[0].argc = 3;
-	charray_add( &(config.directives[0].argv), slapi_ch_strdup( "index" ));
-	charray_add( &(config.directives[0].argv), slapi_ch_strdup( attr_changenumber ));
-	charray_add( &(config.directives[0].argv), slapi_ch_strdup( "eq" ));
-
-    /* Set up the database directory */
-    config.directives[1].argv = NULL;
-    config.directives[1].argc = 2;
-    charray_add( &(config.directives[1].argv), slapi_ch_strdup( "directory" ));
-    charray_add( &(config.directives[1].argv), slapi_ch_strdup( cl_dir ));
-
-    /* Override the entry cache size */
-    config.directives[2].argv = NULL;
-    config.directives[2].argc = 2;
-    charray_add( &(config.directives[2].argv), slapi_ch_strdup( "cachesize" ));
-    charray_add( &(config.directives[2].argv), slapi_ch_strdup( "10" ));
-
-    /* Override the database cache size */
-    config.directives[3].argv = NULL;
-    config.directives[3].argc = 2;
-    charray_add( &(config.directives[3].argv), slapi_ch_strdup( "dbcachesize" ));
-    charray_add( &(config.directives[3].argv), slapi_ch_strdup( "1000000" ));
-   
-    /* Override the allids threshold */
-    config.directives[4].argv = NULL;
-    config.directives[4].argc = 2;
-    charray_add( &(config.directives[4].argv), slapi_ch_strdup( "allidsthreshold" ));
-	/* assumes sizeof(int) >= 32 bits */
-    charray_add( &(config.directives[4].argv), slapi_ch_strdup( "2147483647" )); 
-
-	/* rbe = slapi_be_create_instance(&config, LDBM_TYPE); */
-	rbe= NULL;
-
-	/* free memory allocated to argv */
-	for (i = 0; i < dir_count; i++)
-	{
-		charray_free (config.directives[i].argv);
-	}
-
-	slapi_ch_free ((void **)&config.directives);
-	slapi_ch_free ((void **)&cl_dir);
-	slapi_ch_free ((void **)&cl_suffix);
- 
-	if (rbe == NULL)
-	{
-		slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, 
-						"Error: failed to create changelog backend. "
-						"Replication disabled.\n");
-		return -1;
-	}
-
-    set_repl_backend (rbe);
-
-	changelog4_init_trimming ();
-
-	return 0;   
-}
-
-/* Name: changelog4_start_be
- * Parameters: none
- * Return: 0 if successful, non 0 otherwise
- * Description: starts the changelog backend; backend must be configured
- *				first via call to changelog4_create_be
- */
-static int
-changelog4_start_be ()
-{
-	int rc;
-	IFP startfn = NULL;
-	Slapi_PBlock *pb;
-	Slapi_Backend *rbe = get_repl_backend ();
-	
-	if (rbe)
-	{
-		pb = slapi_pblock_new();
-		rc = slapi_be_getentrypoint(rbe, SLAPI_PLUGIN_START_FN, (void**)&startfn, pb);
-		if (rc != 0)
-		{
-			slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, 
-							"Error: backend start entry point is missing. "
-							"Replication subsystem disabled.\n");
-			slapi_pblock_destroy (pb);
-			set_repl_backend( NULL );
-			return -1;
-		}
-
-		rc = startfn (pb);
-		slapi_pblock_destroy (pb);
-
-		if (rc != 0)
-		{
-			slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, 
-						"Error: Failed to start changelog backend. "
-                        "Replication subsystem disabled.\n");
-			set_repl_backend( NULL );
-			return -1;
-		}
-	}
-
-	return 0;
-}
-
diff --git a/ldap/servers/plugins/replication/legacy_consumer.c b/ldap/servers/plugins/replication/legacy_consumer.c
deleted file mode 100644
index a1819b7..0000000
--- a/ldap/servers/plugins/replication/legacy_consumer.c
+++ /dev/null
@@ -1,701 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-
-/*
- * repl_legacy_consumer.c - support for legacy replication (consumer-side)
- *
- * Support for legacy replication involves correctly dealing with
- * the addition and removal of attribute types "copiedFrom" and
- * "copyingFrom". The behavior is:
- * 1) If a copiedFrom appears in an entry, and that entry is the root
- *    of a replicated area, then put the backend into "refer on update"
- *    mode and install a referral corresponding to the URL contained
- *    in the copiedFrom attribute. This referral overrides the mode
- *    of the replica, e.g. if it was previously an updateable replica,
- *    it now becomes read-only except for the updatedn.
- * 2) If a copiedFrom disappears from an entry, or the entry containing
- *    the copiedFrom is removed, restore the backend to the state
- *    determined by the DS 5.0 replica configuration.
- * 3) If a "copyingFrom" referral appears in an entry, and that entry
- *    is the root of a replicated area, then put the backend into
- *    "refer all operations" mode and install a referral corresponding
- *    to the URL contained in the copyingFrom attribute. This referral
- *    overrides the mode of the replica, e.g if it was previously an
- *    updateable replica, it now becomes read-only and refers all
- *    operations except for the updatedn.
- * 4) If a copyingFrom disappears from an entry, or the entry containing
- *    the copyingFrom is removed, restore the backend to the state
- *    determined by the DS 5.0 replica configuration.
- */
-
-
-#include "repl5.h"
-#include "repl.h"
-
-/* Forward Declarations */
-static int legacy_consumer_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg);
-static int legacy_consumer_config_modify (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg);
-static int legacy_consumer_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg);
-
-static int legacy_consumer_extract_config(Slapi_Entry* entry, char *returntext);
-static int legacy_consumer_read_config ();
-static void legacy_consumer_encode_pw (Slapi_Entry *e);
-static void set_legacy_purl (Slapi_PBlock *pb, const char *purl);
-static int get_legacy_referral (Slapi_Entry *e, char **referral, char **state);
-
-/* LEGACY_CONSUMER_CONFIG_DN is no need to be normalized. */
-#define LEGACY_CONSUMER_CONFIG_DN "cn=legacy consumer," REPL_CONFIG_TOP
-#define LEGACY_CONSUMER_FILTER "(objectclass=*)"
-
-/* Configuration parameters local to this module */
-static Slapi_DN *legacy_consumer_replicationdn = NULL;
-static char *legacy_consumer_replicationpw = NULL;
-/* Lock which protects the above config parameters */
-Slapi_RWLock *legacy_consumer_config_lock = NULL;
-
-static PRBool
-target_is_a_replica_root(Slapi_PBlock *pb, const Slapi_DN **root)
-{
-	Slapi_DN *sdn = NULL;
-	PRBool return_value = PR_FALSE;
-	Object *repl_obj;
-
-	slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn);
-	if (NULL == sdn) {
-		return return_value;
-	}
-	repl_obj = replica_get_replica_from_dn(sdn);
-	if (NULL != repl_obj)
-	{
-		Replica *r = object_get_data(repl_obj);
-		*root = replica_get_root(r);
-		return_value = PR_TRUE;
-		object_release(repl_obj);
-	}
-	else
-	{
-		*root = NULL;
-		return_value = PR_FALSE;
-	}
-	return return_value;
-}
-
-
-
-static int
-parse_cfstring(const char *cfstring, char **referral, char **generation, char **lastreplayed)
-{
-	int return_value = -1;
-    char *ref, *gen, *lastplayed;
-
-	if (cfstring != NULL)
-	{
-		char *tmp;
-		char *cfcopy = slapi_ch_strdup(cfstring);
-		ref = cfcopy;
-		tmp = strchr(cfcopy, ' ');
-		if (NULL != tmp)
-		{
-			*tmp++ = '\0';
-			while ('\0' != *tmp && ' ' == *tmp) tmp++;
-			gen = tmp;
-			tmp = strchr(gen, ' ');
-			if (NULL != tmp)
-			{
-				*tmp++ = '\0';
-				while ('\0' != *tmp && ' ' == *tmp) tmp++;
-				lastplayed = tmp;
-				return_value = 0;
-			}
-		}
-		
-        if (return_value == 0)
-		{
-            if (referral)
-			    *referral = slapi_ch_strdup(ref);
-            if (generation)
-			    *generation = slapi_ch_strdup(gen);
-            if (lastreplayed)
-			    *lastreplayed = slapi_ch_strdup(lastplayed);
-		}
-		slapi_ch_free((void **)&cfcopy);
-	}
-	return return_value;
-}
-
-
-
-/*
- * This is called from the consumer post-op plugin point.
- * It's called if:
- * 1) The operation is an add or modify operation, and a
- *    copiedfrom/copyingfrom was found in the entry/mods, or
- * 2) the operation is a delete operation, or
- * 3) the operation is a moddn operation.
- */
-
-void
-process_legacy_cf(Slapi_PBlock *pb)
-{
-	consumer_operation_extension *opext;
-	Slapi_Operation *op;
-    char *referral_array[2] = {0};
-    char *referral;
-	char *state;
-	int rc;
-    const Slapi_DN *replica_root_sdn = NULL;
-    Slapi_Entry *e;
-
-	slapi_pblock_get(pb, SLAPI_OPERATION, &op);
-	opext = (consumer_operation_extension*) repl_con_get_ext (REPL_CON_EXT_OP, op);
-    
-    if (opext->has_cf)
-    {
-        PR_ASSERT (operation_get_type (op) == SLAPI_OPERATION_ADD || 
-                   operation_get_type (op) == SLAPI_OPERATION_MODIFY);
-	    
-        if ((PR_FALSE == target_is_a_replica_root(pb, &replica_root_sdn)) ||
-			(NULL == replica_root_sdn)){
-			return;
-		}
-
-        slapi_pblock_get (pb, SLAPI_ENTRY_POST_OP, &e);
-        PR_ASSERT (e);
-
-		if (NULL == e)
-			return;
-		
-		rc = get_legacy_referral (e, &referral, &state);
-        if (rc == 0)
-        {
-            referral_array[0] = referral;
-            referral_array[1] = NULL;
-			repl_set_mtn_state_and_referrals(replica_root_sdn, state, NULL, NULL,
-											 referral_array);
-            /* set partial url in the replica_object */
-            set_legacy_purl (pb, referral);
-
-            slapi_ch_free((void **)&referral);
-	    }
-			    
-    }
-}
-
-void legacy_consumer_be_state_change (void *handle, char *be_name,
-	                                  int old_be_state, int new_be_state)
-{
-    Object *r_obj;
-    Replica *r;
-
-    /* we only interested when a backend is coming online */
-    if (new_be_state == SLAPI_BE_STATE_ON)
-    {
-        r_obj = replica_get_for_backend (be_name);
-        if (r_obj)
-        {
-            r = (Replica*)object_get_data (r_obj);
-            PR_ASSERT (r);
-
-            if (replica_is_legacy_consumer (r))
-                legacy_consumer_init_referrals (r);
-
-            object_release (r_obj);
-        }
-    }    
-}
-	
-	   
-static int
-dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg)
-{
-	*returncode = LDAP_UNWILLING_TO_PERFORM;
-    return SLAPI_DSE_CALLBACK_ERROR;
-}
-
-int
-legacy_consumer_config_init()
-{
-    /* The FE DSE *must* be initialised before we get here */
-	int rc;
-
-	if ((legacy_consumer_config_lock = slapi_new_rwlock()) == NULL) {
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
-				"Failed to create legacy_consumer config read-write lock\n");
-		exit(1);
-	}
-
-	rc = legacy_consumer_read_config ();
-	if (rc != LDAP_SUCCESS)
-	{
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-			"Failed to initialize legacy replication configuration\n");
-		return 1;
-	}
-    
-	slapi_config_register_callback(SLAPI_OPERATION_ADD,DSE_FLAG_PREOP,LEGACY_CONSUMER_CONFIG_DN,LDAP_SCOPE_SUBTREE,LEGACY_CONSUMER_FILTER,legacy_consumer_config_add,NULL); 
-    slapi_config_register_callback(SLAPI_OPERATION_MODIFY,DSE_FLAG_PREOP,LEGACY_CONSUMER_CONFIG_DN,LDAP_SCOPE_SUBTREE,LEGACY_CONSUMER_FILTER,legacy_consumer_config_modify,NULL);
-    slapi_config_register_callback(SLAPI_OPERATION_MODRDN,DSE_FLAG_PREOP,LEGACY_CONSUMER_CONFIG_DN,LDAP_SCOPE_SUBTREE,LEGACY_CONSUMER_FILTER,dont_allow_that,NULL);
-    slapi_config_register_callback(SLAPI_OPERATION_DELETE,DSE_FLAG_PREOP,LEGACY_CONSUMER_CONFIG_DN,LDAP_SCOPE_SUBTREE,LEGACY_CONSUMER_FILTER,legacy_consumer_config_delete,NULL); 
-
-    return 0;
-}
-
-static int 
-legacy_consumer_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg)
-{
-    int rc;	
-
-	rc = legacy_consumer_extract_config(e, returntext);
-	if (rc != LDAP_SUCCESS)
-	{
-		*returncode = rc;
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Failed to configure legacy replication\n");
-		return SLAPI_DSE_CALLBACK_ERROR;
-	}
-    /* make sure that the password is encoded */
-    legacy_consumer_encode_pw(e);
-
-    slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "legacy_consumer_config_add: "
-                    "successfully configured legacy consumer credentials\n");
-
-	return SLAPI_DSE_CALLBACK_OK;
-}
-
-#define config_copy_strval( s ) s ? slapi_ch_strdup (s) : NULL;
-
-static int 
-legacy_consumer_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg)
-{
-    int rc= 0;
-   	LDAPMod **mods;
-	int not_allowed = 0;
-	int i;
-
-	if (returntext)
-	{
-		returntext[0] = '\0';
-	}
-	*returncode = LDAP_SUCCESS;
-
-
-	slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods );
-	slapi_rwlock_wrlock (legacy_consumer_config_lock);
-		
-	for (i = 0; mods && (mods[i] && (!not_allowed)); i++)
-	{
-		if (mods[i]->mod_op & LDAP_MOD_DELETE)
-		{
-			/* We don't support deleting an attribute from cn=config */
-		}
-		else
-		{
-			int j;
-			for (j = 0; ((mods[i]->mod_values[j]) && (LDAP_SUCCESS == rc)); j++)
-			{
-				char *config_attr, *config_attr_value;
-				int mod_type;
-				config_attr = (char *) mods[i]->mod_type; 
-				config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val;
-				/* replace existing value */
-				mod_type = mods[i]->mod_op & ~LDAP_MOD_BVALUES;
-				if ( strcasecmp (config_attr, CONFIG_LEGACY_REPLICATIONDN_ATTRIBUTE ) == 0 )
-				{
-                    if (legacy_consumer_replicationdn)
-                            slapi_sdn_free (&legacy_consumer_replicationdn);
-
-					if (mod_type == LDAP_MOD_REPLACE)
-					{
-                        if (config_attr_value)
-						    legacy_consumer_replicationdn = slapi_sdn_new_dn_byval (config_attr_value);
-					}
-					else if (mod_type == LDAP_MOD_DELETE)
-					{
-						legacy_consumer_replicationdn = NULL;
-					}
-					else if (mod_type == LDAP_MOD_ADD)
-					{
-						if (legacy_consumer_replicationdn != NULL)
-						{
-							not_allowed = 1;
-							slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, 
-									"Multiple replicationdns not permitted." );
-						}
-						else
-						{
-                            if (config_attr_value)
-							    legacy_consumer_replicationdn = slapi_sdn_new_dn_byval (config_attr_value);
-						}
-					}
-				}
-                else if ( strcasecmp ( config_attr, CONFIG_LEGACY_REPLICATIONPW_ATTRIBUTE ) == 0 )
-                {
-                    if (mod_type == LDAP_MOD_REPLACE)
-                    {
-                        slapi_ch_free_string(&legacy_consumer_replicationpw);
-                        legacy_consumer_replicationpw = config_copy_strval(config_attr_value);
-                    }
-                    else if (mod_type == LDAP_MOD_DELETE)
-                    {
-                        slapi_ch_free_string(&legacy_consumer_replicationpw);
-                    }
-                    else if (mod_type == LDAP_MOD_ADD)
-                    {
-                        if (legacy_consumer_replicationpw != NULL)
-                        {
-                            not_allowed = 1;
-                            slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name,
-								"Multiple replicationpws not permitted." );
-                        }
-                        else
-                        {
-                            slapi_ch_free_string(&legacy_consumer_replicationpw);
-                            legacy_consumer_replicationpw = config_copy_strval(config_attr_value);
-                        }
-                    }
-                }
-			}
-		}
-	}
-
-	slapi_rwlock_unlock (legacy_consumer_config_lock);
-
-
-	if (not_allowed)
-	{
-		slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, 
-						"Failed to modify legacy replication configuration\n" );
-		*returncode= LDAP_CONSTRAINT_VIOLATION;
-		return SLAPI_DSE_CALLBACK_ERROR;
-	}
-
-    /* make sure that the password is encoded */
-    legacy_consumer_encode_pw (e);
-
-	return SLAPI_DSE_CALLBACK_OK;
-}
-
-static int 
-legacy_consumer_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg)
-{
-	
-	slapi_rwlock_wrlock (legacy_consumer_config_lock);
-    if (legacy_consumer_replicationdn)
-        slapi_sdn_free (&legacy_consumer_replicationdn);
-    slapi_ch_free_string(&legacy_consumer_replicationpw);
-	legacy_consumer_replicationdn = NULL;
-	slapi_rwlock_unlock (legacy_consumer_config_lock);
-
-	*returncode = LDAP_SUCCESS;
-	return SLAPI_DSE_CALLBACK_OK;
-}
-
-/*
- * Given the changelog configuration entry, extract the configuration directives.
- */
-static int
-legacy_consumer_extract_config(Slapi_Entry* entry, char *returntext)
-{
-	int rc = LDAP_SUCCESS; /* OK */
-	char *arg;
-
-  	slapi_rwlock_wrlock (legacy_consumer_config_lock);
-
-    arg= slapi_entry_attr_get_charptr(entry,CONFIG_LEGACY_REPLICATIONDN_ATTRIBUTE);
-    if (arg)
-	    legacy_consumer_replicationdn = slapi_sdn_new_dn_passin (arg);
-
-    arg= slapi_entry_attr_get_charptr(entry,CONFIG_LEGACY_REPLICATIONPW_ATTRIBUTE);
-    slapi_ch_free_string(&legacy_consumer_replicationpw);
-    legacy_consumer_replicationpw = arg;
-
-	slapi_rwlock_unlock (legacy_consumer_config_lock);
-
-	return rc;
-}
-
-
-
-
-static int 
-legacy_consumer_read_config ()
-{
-    int rc = LDAP_SUCCESS;
-    int scope= LDAP_SCOPE_BASE;
-    Slapi_PBlock *pb;
-    
-    pb = slapi_pblock_new ();
-    slapi_search_internal_set_pb (pb, LEGACY_CONSUMER_CONFIG_DN, scope,
-		"(objectclass=*)", NULL /*attrs*/, 0 /* attrs only */,
-		NULL /* controls */, NULL /* uniqueid */,
-		repl_get_plugin_identity(PLUGIN_LEGACY_REPLICATION), 0 /* actions */);
-    slapi_search_internal_pb (pb);
-    slapi_pblock_get( pb, SLAPI_PLUGIN_INTOP_RESULT, &rc );
-    if ( LDAP_SUCCESS == rc )
-	{
-        Slapi_Entry **entries = NULL;
-        slapi_pblock_get( pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries );
-        if ( NULL != entries && NULL != entries[0])
-		{
-        	/* Extract the config info from the changelog entry */
-			rc = legacy_consumer_extract_config(entries[0], NULL);
-        }
-    }
-    else
-	{
-        rc = LDAP_SUCCESS;
-	}
-    slapi_free_search_results_internal(pb);
-    slapi_pblock_destroy(pb);
-
-    return rc;
-}
-
-
-int
-legacy_consumer_is_replicationdn(const char *dn)
-{
-	int return_value = 0; /* Assume not */
-
-	if (NULL != dn && '\0' != dn[0])
-	{
-		if (NULL != legacy_consumer_replicationdn) 
-        {
-            Slapi_DN *sdn = slapi_sdn_new_dn_byref (dn);
-
-			if (slapi_sdn_compare (legacy_consumer_replicationdn, sdn) == 0) {
-				return_value = 1;
-			}
-
-            slapi_sdn_free (&sdn);
-		}
-	}
-    return return_value;
-}
-
-
-int
-legacy_consumer_is_replicationpw(struct berval *pwval)
-{
-	int return_value = 0; /* Assume not */
-
-	if (NULL != pwval && NULL != pwval->bv_val)
-	{
-		if (NULL != legacy_consumer_replicationpw &&
-			'\0' != legacy_consumer_replicationpw[0]) {
-			struct berval *pwvals[2];
-			struct berval config_pw;
-			
-			config_pw.bv_val = legacy_consumer_replicationpw;
-			config_pw.bv_len = strlen(legacy_consumer_replicationpw);
-			pwvals[0] = &config_pw;
-			pwvals[1] = NULL;
-
-			return_value = slapi_pw_find(pwvals, pwval) == 0;
-		}
-	}
-    return return_value;
-}
-
-static void
-legacy_consumer_encode_pw (Slapi_Entry *e)
-{
-	char *updatepw = slapi_entry_attr_get_charptr(e, 
-		CONFIG_LEGACY_REPLICATIONPW_ATTRIBUTE);
-	int is_encoded;
-	char *encoded_value = NULL;
-
-	if (updatepw != NULL)
-	{
-		is_encoded = slapi_is_encoded (updatepw);
-
-		if (!is_encoded)
-		{
-			encoded_value =	slapi_encode (updatepw, "SHA");
-		}
-
-		if (encoded_value)
-		{
-			slapi_entry_attr_set_charptr(e,
-				CONFIG_LEGACY_REPLICATIONPW_ATTRIBUTE, encoded_value);
-		}
-	}
-}
-
-static void
-set_legacy_purl (Slapi_PBlock *pb, const char *purl)
-{
-    Object *r_obj;
-    Replica *r;
-
-    r_obj = replica_get_replica_for_op (pb);
-    PR_ASSERT (r_obj);
-    r = (Replica*)object_get_data (r_obj);
-    PR_ASSERT (r && replica_is_legacy_consumer(r));
-
-    replica_set_legacy_purl (r, purl);
-
-    object_release (r_obj);
-}
-
-/* this function get referrals from an entry.
-   Returns 0 if successful
-           1 if no referrals are present
-          -1 in case of error
- */
-static int 
-get_legacy_referral (Slapi_Entry *e, char **referral, char **state)
-{
-    char* pat = "ldap://%s";
-    const char *val = NULL;
-    char *hostport;
-    int rc = 1;
-    Slapi_Attr *attr;
-    const Slapi_Value *sval;
-
-    PR_ASSERT (e && referral && state);
-    
-    /* Find any copiedFrom/copyingFrom attributes -
-       copyingFrom has priority */
-	if (slapi_entry_attr_find(e, type_copyingFrom, &attr) == 0)
-	{
-		slapi_attr_first_value(attr, (Slapi_Value **)&sval);	
-        val = slapi_value_get_string(sval);
-        *state = STATE_REFERRAL;
-	}
-	else if (slapi_entry_attr_find(e, type_copiedFrom, &attr) == 0)
-	{
-		slapi_attr_first_value(attr, (Slapi_Value **)&sval);	
-        val = slapi_value_get_string(sval);
-        *state = STATE_UPDATE_REFERRAL;        
-	}        
-
-    if (val)
-    {
-        rc = parse_cfstring(val, &hostport, NULL, NULL);
-        if (rc != 0)
-        {
-            const char *target_dn = slapi_entry_get_dn_const(e);
-		    slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: a copiedFrom "
-			"or copyingFrom attribute was added to or removed from an "
-			"entry that is not the root of a replicated area. It is possible "
-			"that a legacy replication supplier is incorrectly configured "
-			"to supply updates to the subtree rooted at %s\n",
-			target_dn == NULL ? "null" : target_dn);
-        }
-        else
-        {
-            *referral = slapi_ch_smprintf (pat, hostport);
-
-            slapi_ch_free ((void**)&hostport);
-        }
-    }
-    else
-    {
-        rc = 1; /* no copiedFrom or copyingFrom int the entry */
-    }
-  
-    return rc;
-}
-
-/* this function is called during server startup or when replica's data
-   is reloaded. It sets up referrals in the mapping tree based on the
-   copiedFrom and copyingFrom attributes. It also sets up partial url in
-   the replica object used to update RUV.
-   Returns 0 if successful and -1 otherwise
-
- */
-int
-legacy_consumer_init_referrals (Replica *r)
-{
-    Slapi_PBlock *pb;
-    const Slapi_DN *root_sdn; 
-	const char *root_dn;
-    char *attrs[] = {"copiedFrom", "copyingFrom"};
-    int rc;
-    Slapi_Entry **entries = NULL;
-    char *referral = NULL;
-    char *referral_array[2];
-    char *state = NULL;
-
-    PR_ASSERT (r);
-
-    pb = slapi_pblock_new ();
-    PR_ASSERT (pb);
-
-    root_sdn = replica_get_root(r);
-    PR_ASSERT (root_sdn);
-
-    root_dn = slapi_sdn_get_ndn(root_sdn);
-    PR_ASSERT (root_dn);
-
-    slapi_search_internal_set_pb (pb, root_dn, LDAP_SCOPE_BASE, "objectclass=*",attrs, 
-                                  0 /* attrsonly */, NULL /* controls */, 
-                                  NULL /* uniqueid */, 
-                                  repl_get_plugin_identity (PLUGIN_LEGACY_REPLICATION), 
-                                  0 /* flags */);
-								  
-    slapi_search_internal_pb (pb);
-
-    slapi_pblock_get (pb, SLAPI_PLUGIN_INTOP_RESULT, &rc);
-    if (rc != LDAP_SUCCESS)
-    {
-        if (rc == LDAP_REFERRAL)
-        {
-            /* We are in referral mode, probably because ORC failed */
-            slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "legacy_consumer_init_referrals "
-                            "data for replica %s is in referral mode due to failed "
-                            "initialization. Replica need to be reinitialized\n",
-                            root_dn);
-            rc = 0;
-        }
-        else
-        {
-            slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "legacy_consumer_init_referrals "
-                            "failed to obtain root entry for replica %s; LDAP error - %d\n",
-                            root_dn, rc);
-            rc = -1;
-        }
-
-        goto done;
-    }
-
-    slapi_pblock_get (pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
-
-    PR_ASSERT (entries && entries[0]);
-
-    rc = get_legacy_referral (entries[0], &referral, &state);
-    if (rc == 0)
-    {         
-        referral_array[0] = referral;
-        referral_array[1] = NULL;
-        repl_set_mtn_state_and_referrals(root_sdn, state, NULL, NULL, referral_array);
-
-        /* set purtial url in the replica_object */
-        replica_set_legacy_purl (r, referral);
-
-        slapi_ch_free((void **)&referral);
-	 }
-     else if (rc == 1) /* no referrals - treat as success */
-     {
-        rc = 0;
-     }
-			       
-    slapi_free_search_results_internal (pb);
-
-done:
-    
-    slapi_pblock_destroy (pb);
-    return rc;
-}
-
diff --git a/ldap/servers/plugins/replication/repl.h b/ldap/servers/plugins/replication/repl.h
index 69667c6..2ee45ed 100644
--- a/ldap/servers/plugins/replication/repl.h
+++ b/ldap/servers/plugins/replication/repl.h
@@ -40,7 +40,6 @@
 #include "portable.h" /* GGOODREPL - is this cheating? */
 #include "ldaplog.h"
 #include "repl_shared.h"
-#include "cl4.h"
 
 typedef struct schedule_item
 {
@@ -167,35 +166,11 @@ typedef struct repl {
 int repl_rootdse_init();
 
 /* In repl.c */
-Slapi_Entry *get_changerecord(const chglog4Info *cl4, changeNumber cnum, int *err);
-changeNumber replog_get_firstchangenum(const chglog4Info *cl4, int *err);
-changeNumber replog_get_lastchangenum(const chglog4Info *cl4, int *err);
 void changelog_housekeeping(time_t cur_time );
 
 /* In repl_config.c */
 int repl_config_init ();
 
-/* Legacy Plugin Functions */
-
-int legacy_preop_bind( Slapi_PBlock *pb );
-int legacy_bepreop_bind( Slapi_PBlock *pb );
-int legacy_postop_bind( Slapi_PBlock *pb );
-int legacy_preop_add( Slapi_PBlock *pb );
-int legacy_bepreop_add( Slapi_PBlock *pb );
-int legacy_postop_add( Slapi_PBlock *pb );
-int legacy_preop_modify( Slapi_PBlock *pb );
-int legacy_bepreop_modify( Slapi_PBlock *pb );
-int legacy_postop_modify( Slapi_PBlock *pb );
-int legacy_preop_modrdn( Slapi_PBlock *pb );
-int legacy_bepreop_modrdn( Slapi_PBlock *pb );
-int legacy_postop_modrdn( Slapi_PBlock *pb );
-int legacy_preop_delete( Slapi_PBlock *pb );
-int legacy_bepreop_delete( Slapi_PBlock *pb );
-int legacy_postop_delete( Slapi_PBlock *pb );
-int legacy_preop_search( Slapi_PBlock *pb );
-int legacy_preop_compare( Slapi_PBlock *pb );
-int legacy_pre_entry( Slapi_PBlock *pb );
-int legacy_bepostop_assignchangenum( Slapi_PBlock *pb );
 
 int replication_plugin_start( Slapi_PBlock *pb );
 int replication_plugin_poststart( Slapi_PBlock *pb );
@@ -240,16 +215,6 @@ extern char	*type_objectclass;
 typedef int	(*IFP)();
 #endif
 
-/* In cl4.c */
-
-changeNumber ldapi_assign_changenumber(chglog4Info *cl4);
-changeNumber ldapi_get_last_changenumber(chglog4Info *cl4);
-changeNumber ldapi_get_first_changenumber(chglog4Info *cl4);
-void ldapi_commit_changenumber(chglog4Info *cl4, changeNumber cnum);
-void ldapi_set_first_changenumber(chglog4Info *cl4, changeNumber cnum);
-void ldapi_set_last_changenumber(chglog4Info *cl4, changeNumber cnum);
-void ldapi_initialize_changenumbers(chglog4Info *cl4, changeNumber first, changeNumber last);
-
 #define	LDBM_TYPE				"ldbm"
 #define	CHANGELOG_LDBM_TYPE		"changelog-ldbm"
 
diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h
index 307da82..c13dd0c 100644
--- a/ldap/servers/plugins/replication/repl5.h
+++ b/ldap/servers/plugins/replication/repl5.h
@@ -27,7 +27,6 @@
 #include "repl_shared.h"
 #include "llist.h"
 #include "repl5_ruv.h"
-#include "cl4.h"
 #include "plstr.h"
 
 #define START_UPDATE_DELAY 2 /* 2 second */
diff --git a/ldap/servers/plugins/replication/repl5_plugins.c b/ldap/servers/plugins/replication/repl5_plugins.c
index c2fa214..0f3b9c8 100644
--- a/ldap/servers/plugins/replication/repl5_plugins.c
+++ b/ldap/servers/plugins/replication/repl5_plugins.c
@@ -56,7 +56,6 @@ static int process_postop (Slapi_PBlock *pb);
 static int cancel_opcsn (Slapi_PBlock *pb); 
 static int ruv_tombstone_op (Slapi_PBlock *pb);
 static PRBool process_operation (Slapi_PBlock *pb, const CSN *csn);
-static PRBool is_mmr_replica (Slapi_PBlock *pb);
 static const char *replica_get_purl_for_op (const Replica *r, Slapi_PBlock *pb, const CSN *opcsn);
 
 /*
@@ -147,29 +146,9 @@ multimaster_preop_add (Slapi_PBlock *pb)
     Slapi_Operation *op;
     int is_replicated_operation;
     int is_fixup_operation;
-    int is_legacy_operation;
 
     slapi_pblock_get(pb, SLAPI_OPERATION, &op);
 
-    /* If there is no replica or it is a legacy consumer - we don't need to continue.
-       Legacy plugin is handling 4.0 consumer code */
-    /* but if it is legacy, csngen_handler needs to be assigned here */
-    is_legacy_operation =
-        operation_is_flag_set(op,OP_FLAG_LEGACY_REPLICATION_DN);
-    if (is_legacy_operation)
-    {
-        copy_operation_parameters(pb);
-        slapi_operation_set_csngen_handler(op,
-                                           (void*)replica_generate_next_csn);
-        return SLAPI_PLUGIN_SUCCESS;
-    }
-
-    if (!is_mmr_replica (pb))
-    {
-        copy_operation_parameters(pb);
-        return SLAPI_PLUGIN_SUCCESS;
-    }
-
     is_replicated_operation= operation_is_flag_set(op,OP_FLAG_REPLICATED);
     is_fixup_operation= operation_is_flag_set(op,OP_FLAG_REPL_FIXUP);
 
@@ -276,30 +255,9 @@ multimaster_preop_delete (Slapi_PBlock *pb)
     Slapi_Operation *op;
     int is_replicated_operation;
     int is_fixup_operation;
-    int is_legacy_operation;
 
     slapi_pblock_get(pb, SLAPI_OPERATION, &op);
 
-    /* If there is no replica or it is a legacy consumer - we don't need to continue.
-       Legacy plugin is handling 4.0 consumer code */
-    /* but if it is legacy, csngen_handler needs to be assigned here */
-    is_legacy_operation =
-        operation_is_flag_set(op,OP_FLAG_LEGACY_REPLICATION_DN);
-    if (is_legacy_operation)
-    {
-        copy_operation_parameters(pb);
-    	slapi_operation_set_replica_attr_handler ( op, (void*)replica_get_attr );
-        slapi_operation_set_csngen_handler(op,
-                                           (void*)replica_generate_next_csn);
-        return SLAPI_PLUGIN_SUCCESS;
-    }
-
-    if (!is_mmr_replica (pb))
-    {
-        copy_operation_parameters(pb);
-        return SLAPI_PLUGIN_SUCCESS;
-    }
-
     is_replicated_operation= operation_is_flag_set(op,OP_FLAG_REPLICATED);
     is_fixup_operation= operation_is_flag_set(op,OP_FLAG_REPL_FIXUP);
 
@@ -376,29 +334,9 @@ multimaster_preop_modify (Slapi_PBlock *pb)
     Slapi_Operation *op;
     int is_replicated_operation;
     int is_fixup_operation;
-    int is_legacy_operation;
 
     slapi_pblock_get(pb, SLAPI_OPERATION, &op);
 
-    /* If there is no replica or it is a legacy consumer - we don't need to continue.
-       Legacy plugin is handling 4.0 consumer code */
-    /* but if it is legacy, csngen_handler needs to be assigned here */
-    is_legacy_operation =
-        operation_is_flag_set(op,OP_FLAG_LEGACY_REPLICATION_DN);
-    if (is_legacy_operation)
-    {
-        copy_operation_parameters(pb);
-        slapi_operation_set_csngen_handler(op,
-                                           (void*)replica_generate_next_csn);
-        return SLAPI_PLUGIN_SUCCESS;
-    }
-
-    if (!is_mmr_replica (pb))
-    {
-        copy_operation_parameters(pb);
-        return SLAPI_PLUGIN_SUCCESS;
-    }
-
     is_replicated_operation= operation_is_flag_set(op,OP_FLAG_REPLICATED);
     is_fixup_operation= operation_is_flag_set(op,OP_FLAG_REPL_FIXUP);
 
@@ -478,29 +416,9 @@ multimaster_preop_modrdn (Slapi_PBlock *pb)
     Slapi_Operation *op;
     int is_replicated_operation;
     int is_fixup_operation;
-    int is_legacy_operation;
 
     slapi_pblock_get(pb, SLAPI_OPERATION, &op);
 
-    /* If there is no replica or it is a legacy consumer - we don't need to continue.
-       Legacy plugin is handling 4.0 consumer code */
-    /* but if it is legacy, csngen_handler needs to be assigned here */
-    is_legacy_operation =
-        operation_is_flag_set(op,OP_FLAG_LEGACY_REPLICATION_DN);
-    if (is_legacy_operation)
-    {
-        copy_operation_parameters(pb);
-        slapi_operation_set_csngen_handler(op,
-                                           (void*)replica_generate_next_csn);
-        return SLAPI_PLUGIN_SUCCESS;
-    }
-
-    if (!is_mmr_replica (pb))
-    {
-        copy_operation_parameters(pb);
-        return SLAPI_PLUGIN_SUCCESS;
-    }
-
     is_replicated_operation= operation_is_flag_set(op,OP_FLAG_REPLICATED);
     is_fixup_operation= operation_is_flag_set(op,OP_FLAG_REPL_FIXUP);
 
@@ -997,7 +915,6 @@ copy_operation_parameters(Slapi_PBlock *pb)
 static int
 update_ruv_component(Replica *replica, CSN *opcsn, Slapi_PBlock *pb)
 {
-    PRBool legacy;
     char *purl;
     int rc = RUV_NOTFOUND;
 
@@ -1005,18 +922,10 @@ update_ruv_component(Replica *replica, CSN *opcsn, Slapi_PBlock *pb)
 		return rc;
 
 	/* Replica configured, so update its ruv */
-	legacy = replica_is_legacy_consumer (replica);
-	if (legacy)
-		purl = replica_get_legacy_purl (replica);
-	else
-		purl = (char*)replica_get_purl_for_op (replica, pb, opcsn);
+	purl = (char*)replica_get_purl_for_op (replica, pb, opcsn);
 
 	rc = replica_update_ruv(replica, opcsn, purl);
 
-	if (legacy)
-	{
-		slapi_ch_free ((void**)&purl);
-	}
 	return rc;
 }
 
@@ -1484,29 +1393,6 @@ process_operation (Slapi_PBlock *pb, const CSN *csn)
     return (rc == RUV_SUCCESS);
 }
 
-static PRBool 
-is_mmr_replica (Slapi_PBlock *pb)
-{
-    Object *r_obj;
-    Replica *r;
-    PRBool mmr;
-
-    r_obj = replica_get_replica_for_op(pb);
-    if (r_obj == NULL)
-    {
-        return PR_FALSE;
-    }   
-
-    r = (Replica*)object_get_data (r_obj);
-    PR_ASSERT (r);
-
-    mmr = !replica_is_legacy_consumer (r);
-
-    object_release (r_obj);
-
-    return mmr;
-}
-
 static const char *replica_get_purl_for_op (const Replica *r, Slapi_PBlock *pb, const CSN *opcsn)
 {
     int is_replicated_op;
@@ -1547,53 +1433,6 @@ static const char *replica_get_purl_for_op (const Replica *r, Slapi_PBlock *pb,
     return purl;   
 }
 
-#ifdef NOTUSED
-/* ONREPL at the moment, I decided not to trim copiedFrom and copyingFrom
-   attributes when sending operation to replicas. This is because, each
-   operation results in a state information stored in the database and
-   if we don't replay all operations we will endup with state inconsistency.
-
-   Keeping the function just in case
- */
-static void strip_legacy_info (slapi_operation_parameters *op_params)
-{
-    switch (op_params->operation_type)
-    {
-        case SLAPI_OPERATION_ADD:       
-                slapi_entry_delete_values_sv(op_params->p.p_add.target_entry, 
-                                             type_copiedFrom, NULL);
-                slapi_entry_delete_values_sv(op_params->p.p_add.target_entry, 
-                                             type_copyingFrom, NULL);
-                break;
-        case SLAPI_OPERATION_MODIFY:
-        {        
-                Slapi_Mods smods;
-                LDAPMod *mod;
-
-                slapi_mods_init_byref(&smods, op_params->p.p_modify.modify_mods);
-                mod = slapi_mods_get_first_mod(&smods);
-                while (mod)
-                {
-                    /* modify just to update copiedFrom or copyingFrom attribute 
-                       does not contain modifiersname or modifytime - so we don't
-                       have to strip them */
-                    if (strcasecmp (mod->mod_type, type_copiedFrom) == 0 ||
-                        strcasecmp (mod->mod_type, type_copyingFrom) == 0)
-                        slapi_mods_remove(&smods);
-                    mod = slapi_mods_get_next_mod(&smods);
-                }
-
-                op_params->p.p_modify.modify_mods = slapi_mods_get_ldapmods_passout (&smods);
-                slapi_mods_done (&smods);
-
-                break;
-        }
-
-        default: break;
-    }
-}
-#endif
-
 /* this function is called when state of a backend changes */
 void 
 multimaster_be_state_change (void *handle, char *be_name, int old_be_state, int new_be_state)
diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c b/ldap/servers/plugins/replication/repl5_protocol_util.c
index ce27a8a..86c4a1a 100644
--- a/ldap/servers/plugins/replication/repl5_protocol_util.c
+++ b/ldap/servers/plugins/replication/repl5_protocol_util.c
@@ -367,14 +367,6 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv)
 						}
 						return_value = ACQUIRE_REPLICA_BUSY;
 						break;
-					case NSDS50_REPL_LEGACY_CONSUMER:
-						/* remote replica is a legacy consumer */
-						slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
-							"%s: Unable to acquire replica: the replica "
-							"is supplied by a legacy supplier. "
-							"Replication is aborting.\n", agmt_get_long_name(prp->agmt));
-						return_value = ACQUIRE_FATAL_ERROR;
-						break;
 					case NSDS50_REPL_REPLICAID_ERROR:
 						/* remote replica detected a duplicate ReplicaID */
 						slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
@@ -650,7 +642,6 @@ protocol_response2string (int response)
         case NSDS50_REPL_BELOW_PURGEPOINT:          return "csn below purge point";
         case NSDS50_REPL_INTERNAL_ERROR:            return "internal error";
         case NSDS50_REPL_REPLICA_RELEASE_SUCCEEDED: return "replica released";
-        case NSDS50_REPL_LEGACY_CONSUMER:           return "replica is a legacy consumer";						
 		case NSDS50_REPL_REPLICAID_ERROR:			return "duplicate replica ID detected";
 		case NSDS50_REPL_UPTODATE:					return "no change to send";
         default:                                    return "unknown error";
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index 8b53f3c..604279b 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -24,7 +24,6 @@
 #define RUV_SAVE_INTERVAL (30 * 1000) /* 30 seconds */
 
 #define REPLICA_RDN				 "cn=replica"
-#define CHANGELOG_RDN            "cn=legacy changelog"
 
 /*
  * A replica is a locally-held copy of a portion of the DIT.
@@ -41,8 +40,6 @@ struct replica {
 	PRUint32			updatedn_group_last_check;
 	int				updatedn_group_check_interval;
 	ReplicaType	 repl_type;			/* is this replica read-only ?			*/
-	PRBool  legacy_consumer;        /* if true, this replica is supplied by 4.0 consumer */
-	char*   legacy_purl;            /* partial url of the legacy supplier   */
 	ReplicaId repl_rid;				/* replicaID							*/
 	Object	*repl_ruv;				/* replica update vector				*/
 	PRBool repl_ruv_dirty;          /* Dirty flag for ruv                   */
@@ -96,8 +93,6 @@ static void abort_csn_callback(const CSN *csn, void *data);
 static void eq_cb_reap_tombstones(time_t when, void *arg);
 static CSN *_replica_get_purge_csn_nolock (const Replica *r);
 static void replica_get_referrals_nolock (const Replica *r, char ***referrals);
-static void replica_clear_legacy_referrals (const Slapi_DN *repl_root_sdn, char **referrals, const char *state);
-static void replica_remove_legacy_attr (const Slapi_DN *repl_root_sdn, const char *attr);
 static int replica_log_ruv_elements_nolock (const Replica *r);
 static void replica_replace_ruv_tombstone(Replica *r);
 static void start_agreements_for_replica (Replica *r, PRBool start);
@@ -259,14 +254,6 @@ replica_new_from_entry (Slapi_Entry *e, char *errortext, PRBool is_add_operation
 										   1000 * r->tombstone_reap_interval);
 	}
 
-    if (r->legacy_consumer)
-    {
-        legacy_consumer_init_referrals (r);
-        slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_new_from_entry: "
-                        "replica for %s was configured as legacy consumer\n",
-                        slapi_sdn_get_dn(r->repl_root));
-    }
-
     replica_check_for_tasks(r, e);
 
 done:
@@ -369,7 +356,6 @@ replica_destroy(void **arg)
 
 	/* slapi_ch_free accepts NULL pointer */
 	slapi_ch_free ((void**)&r->repl_name);
-	slapi_ch_free ((void**)&r->legacy_purl);    
 
 	if (r->repl_lock)
 	{
@@ -999,97 +985,6 @@ replica_set_type (Replica *r, ReplicaType type)
 }
 
 /* 
- * Returns PR_TRUE if this replica is a consumer of 4.0 server
- * and PR_FALSE otherwise
- */
-PRBool
-replica_is_legacy_consumer (const Replica *r)
-{
-	PR_ASSERT(r);
-	return r->legacy_consumer;
-}
-
-/* 
- * Sets the replica type.
- */
-void 
-replica_set_legacy_consumer (Replica *r, PRBool legacy_consumer)
-{
-    int legacy2mmr;
-	Slapi_DN *repl_root_sdn = NULL;
-	char **referrals = NULL;
-	char *replstate = NULL;
-	PR_ASSERT(r);
-
-    replica_lock(r->repl_lock);
-
-    legacy2mmr = r->legacy_consumer && !legacy_consumer;
-
-    /* making the server a regular 5.0 replica */
-    if (legacy2mmr)
-    {
-        slapi_ch_free ((void**)&r->legacy_purl);
-        /* Remove copiedFrom/copyingFrom attributes from the root entry */           
-		/* set the right state in the mapping tree */
-		if (r->repl_type == REPLICA_TYPE_READONLY)
-		{
-			replica_get_referrals_nolock (r, &referrals);
-			replstate = STATE_UPDATE_REFERRAL;
-		}
-		else /* updateable */
-		{
-			replstate = STATE_BACKEND;
-		}
-    }
-
-    r->legacy_consumer = legacy_consumer;
-    repl_root_sdn = slapi_sdn_dup(r->repl_root);
-    replica_unlock(r->repl_lock);
-
-    if (legacy2mmr)
-    {
-		replica_clear_legacy_referrals(repl_root_sdn, referrals, replstate);
-		/* Also change state of the mapping tree node and/or referrals */
-        replica_remove_legacy_attr (repl_root_sdn, type_copiedFrom);
-        replica_remove_legacy_attr (repl_root_sdn, type_copyingFrom);
-    }
-	charray_free(referrals);
-	slapi_sdn_free(&repl_root_sdn);
-}
-
-/* Gets partial url of the legacy supplier - applicable for legacy consumer only */
-char *
-replica_get_legacy_purl (const Replica *r)
-{
-    char *purl;
-
-    replica_lock(r->repl_lock);
-
-    PR_ASSERT (r->legacy_consumer);
-
-    purl = slapi_ch_strdup(r->legacy_purl);
-
-    replica_unlock(r->repl_lock);
-
-    return purl;
-}
-
-void 
-replica_set_legacy_purl (Replica *r, const char *purl)
-{
-    replica_lock(r->repl_lock);
-
-    PR_ASSERT (r->legacy_consumer);
-
-    /* slapi_ch_free accepts NULL pointer */
-    slapi_ch_free ((void**)&r->legacy_purl);
-
-    r->legacy_purl = slapi_ch_strdup (purl);
-
-    replica_unlock(r->repl_lock);
-}
-
-/* 
  * Returns true if sdn is the same as updatedn and false otherwise 
  */
 PRBool 
@@ -1484,7 +1379,7 @@ consumer5_set_mapping_tree_state_for_replica(const Replica *r, RUV *supplierRuv)
 	replica_get_referrals_nolock (r, &replica_referrals); /* replica_referrals has to be free'd */
 	
     /* JCMREPL - What if there's a Total update in progress? */
-	if( (r->repl_type==REPLICA_TYPE_READONLY) || (r->legacy_consumer) )
+	if(r->repl_type==REPLICA_TYPE_READONLY)
 	{
 		state_backend = 0;
 	}
@@ -1950,21 +1845,6 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext)
         r->repl_type = REPLICA_TYPE_READONLY;
     }
 
-    /* get legacy consumer flag */
-    val = slapi_entry_attr_get_charptr (e, type_replicaLegacyConsumer);
-    if (val){
-        if (strcasecmp (val, "on") == 0 || strcasecmp (val, "yes") == 0 ||
-            strcasecmp (val, "true") == 0 || strcasecmp (val, "1") == 0)
-        {
-	        r->legacy_consumer = PR_TRUE;
-        } else {
-            r->legacy_consumer = PR_FALSE;
-        }
-        slapi_ch_free ((void**)&val);
-    } else {
-        r->legacy_consumer = PR_FALSE;
-    }
-
     /* grab and validate the backoff retry settings */
     if(slapi_entry_attr_exists(e, type_replicaBackoffMin)){
         backoff_min = slapi_entry_attr_get_int(e, type_replicaBackoffMin);
@@ -3633,52 +3513,6 @@ replica_get_referrals_nolock (const Replica *r, char ***referrals)
 	}
 }
 
-static void 
-replica_clear_legacy_referrals(const Slapi_DN *repl_root_sdn,
-							   char **referrals, const char *state)
-{
-	repl_set_mtn_state_and_referrals(repl_root_sdn, state, NULL, NULL, referrals);
-}
-
-static void 
-replica_remove_legacy_attr (const Slapi_DN *repl_root_sdn, const char *attr)
-{
-    Slapi_PBlock *pb;
-    Slapi_Mods smods;
-    LDAPControl **ctrls;
-    int rc;
-
-    pb = slapi_pblock_new ();
-    
-    slapi_mods_init(&smods, 1);
-    slapi_mods_add(&smods, LDAP_MOD_DELETE, attr, 0, NULL);
-   
-    
-    ctrls = (LDAPControl**)slapi_ch_malloc (2 * sizeof (LDAPControl*));
-    ctrls[0] = create_managedsait_control ();
-    ctrls[1] = NULL;
-    
-    /* remove copiedFrom/copyingFrom first */
-    slapi_modify_internal_set_pb_ext (pb, repl_root_sdn, 
-                                      slapi_mods_get_ldapmods_passout (&smods),
-                                      ctrls, NULL /*uniqueid */, 
-                                      repl_get_plugin_identity (PLUGIN_MULTIMASTER_REPLICATION) , 
-                                      0 /* operation_flags */);
- 
-    slapi_modify_internal_pb (pb);
-	slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc);
-    if (rc != LDAP_SUCCESS) 
-	{
-        /* this is not a fatal error because the attribute may not be there */
-		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "replica_remove_legacy_attr: "
-			"failed to remove legacy attribute %s for replica %s; LDAP error - %d\n", 
-            attr, slapi_sdn_get_dn(repl_root_sdn), rc);
-	}
-    
-    slapi_mods_done (&smods);
-    slapi_pblock_destroy (pb);
-}
-
 static int 
 replica_log_ruv_elements_nolock (const Replica *r)
 {
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index 14020b7..19a0534 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -224,8 +224,6 @@ replica_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter,
     }
 
 	/* Set the mapping tree node state, and the referrals from the RUV */
-    /* if this server is a 4.0 consumer the referrals are set by legacy plugin */
-    if (!replica_is_legacy_consumer (r))
 	    consumer5_set_mapping_tree_state_for_replica(r, NULL);
 
     /* ONREPL if replica is added as writable we need to execute protocol that
@@ -368,16 +366,9 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
                 {
                     if (apply_mods) {
                         replica_set_referrals(r, NULL);
-                        if (!replica_is_legacy_consumer (r)) {
-                             consumer5_set_mapping_tree_state_for_replica(r, NULL);
-                        }
+                        consumer5_set_mapping_tree_state_for_replica(r, NULL);
                     }
                 }
-                else if (strcasecmp (config_attr, type_replicaLegacyConsumer) == 0)
-                {
-                    if (apply_mods)
-                        replica_set_legacy_consumer (r, PR_FALSE);
-                }
                 else if (strcasecmp (config_attr, type_replicaCleanRUV) == 0 ||
                          strcasecmp (config_attr, type_replicaAbortCleanRUV) == 0)
                 {
@@ -466,9 +457,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
                         replica_set_referrals (r, vs);
                         slapi_mod_done(&smod);
                         slapi_valueset_free(vs);
-						if (!replica_is_legacy_consumer (r)) {
 							consumer5_set_mapping_tree_state_for_replica(r, NULL);
-						}
                     }
                 }
 				else if (strcasecmp (config_attr, type_replicaPurgeDelay) == 0)
@@ -494,18 +483,6 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
 						replica_set_tombstone_reap_interval (r, interval);
 					}
 				}
-                else if (strcasecmp (config_attr, type_replicaLegacyConsumer) == 0)
-                {
-					if (apply_mods && config_attr_value[0])
-                    {
-                        PRBool legacy = (strcasecmp (config_attr_value, "on") == 0) ||
-                                        (strcasecmp (config_attr_value, "true") == 0) ||
-                                        (strcasecmp (config_attr_value, "yes") == 0) ||
-                                        (strcasecmp (config_attr_value, "1") == 0);
-
-                        replica_set_legacy_consumer (r, legacy);
-                    }
-                }
                 /* ignore modifiers attributes added by the server */
                 else if (slapi_attr_is_last_mod(config_attr))
                 {
@@ -1017,9 +994,7 @@ replica_config_change_type_and_id (Replica *r, const char *new_type,
         replica_set_rid(r, rid);
 
         /* Set the mapping tree node, and the list of referrals */
-        /* if this server is a 4.0 consumer the referrals are set by legacy plugin */
-        if (!replica_is_legacy_consumer(r))
-		    consumer5_set_mapping_tree_state_for_replica(r, NULL);
+	consumer5_set_mapping_tree_state_for_replica(r, NULL);
     }
 
     return LDAP_SUCCESS;
diff --git a/ldap/servers/plugins/replication/repl_add.c b/ldap/servers/plugins/replication/repl_add.c
deleted file mode 100644
index e5cb463..0000000
--- a/ldap/servers/plugins/replication/repl_add.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
- 
-#include "slapi-plugin.h"
-#include "repl.h"
-
-
-/* Add Operation Plugin Functions for legacy replication plugin */
-
-int
-legacy_preop_add( Slapi_PBlock *pb )
-{
-    return legacy_preop( pb, "legacy_preop_add", OP_ADD );
-}
-
-int
-legacy_bepreop_add( Slapi_PBlock *pb )
-{
-    int rc= 0; /* OK */
-	return rc;
-}
-
-int
-legacy_postop_add( Slapi_PBlock *pb )
-{
-    return legacy_postop( pb, "legacy_postop_add", OP_ADD );
-}
diff --git a/ldap/servers/plugins/replication/repl_bind.c b/ldap/servers/plugins/replication/repl_bind.c
deleted file mode 100644
index 06bc361..0000000
--- a/ldap/servers/plugins/replication/repl_bind.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
- 
-
-#include "slapi-plugin.h"
-#include "repl.h"
-#include "repl5.h"
-
-
-int
-legacy_preop_bind( Slapi_PBlock *pb )
-{
-    int return_value = 0;
-	const char *dn = NULL;
-	Slapi_DN *sdn = NULL;
-	struct berval *cred = NULL;
-	ber_tag_t method;
-    
-	slapi_pblock_get(pb, SLAPI_BIND_METHOD, &method);
-	slapi_pblock_get(pb, SLAPI_BIND_TARGET_SDN, &sdn);
-	slapi_pblock_get(pb, SLAPI_BIND_CREDENTIALS, &cred);
-	dn = slapi_sdn_get_dn(sdn);
-
-	if (LDAP_AUTH_SIMPLE == method)
-	{
-		if (legacy_consumer_is_replicationdn(dn) && legacy_consumer_is_replicationpw(cred))
-		{
-			/* Successful bind as replicationdn */
-			void *conn = NULL;
-			consumer_connection_extension *connext = NULL;
-#ifdef DEBUG
-	slapi_log_error(SLAPI_LOG_REPL, REPLICATION_SUBSYSTEM, "legacy_preop_bind: begin\n");
-#endif
-			slapi_pblock_get( pb, SLAPI_CONNECTION, &conn );
-			/* TEL 20120529 - Is there any reason we must protect this connext access? */
-			connext = (consumer_connection_extension*) repl_con_get_ext (REPL_CON_EXT_CONN, conn);
-			if (NULL != connext)
-			{
-				connext->is_legacy_replication_dn = 1;
-			}
-			slapi_send_ldap_result(pb, LDAP_SUCCESS, NULL, NULL, 0, NULL);
-			return_value = 1; /* Prevent further processing in front end */
-		}
-	}
-	return return_value;
-
-}
diff --git a/ldap/servers/plugins/replication/repl_compare.c b/ldap/servers/plugins/replication/repl_compare.c
deleted file mode 100644
index 20428ef..0000000
--- a/ldap/servers/plugins/replication/repl_compare.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
- 
-#include "slapi-plugin.h"
-#include "repl.h"
-
-int
-legacy_preop_compare( Slapi_PBlock *pb )
-{
-	int is_replicated_operation = 0;
-	struct berval **referral = NULL;
-	int return_code = 0;
-	Slapi_DN *basesdn = NULL;
-
-	slapi_pblock_get(pb, SLAPI_IS_REPLICATED_OPERATION, &is_replicated_operation);
-	slapi_pblock_get(pb, SLAPI_COMPARE_TARGET_SDN, &basesdn);
-	if (NULL == basesdn) {
-		slapi_send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL,
-				               "Null target DN", 0, NULL );
-
-		return_code = 1;	/* return 1 to prevent further search processing */
-		goto bail;
-	}
-	referral = get_data_source(pb, basesdn, 1, NULL);
-	if (NULL != referral && !is_replicated_operation)
-	{
-		/*
-		 * There is a copyingFrom in this entry or an ancestor.
-		 * Return a referral to the supplier, and we're all done.
-		 */
-		slapi_send_ldap_result(pb, LDAP_REFERRAL, NULL, NULL, 0, referral);
-		return_code = 1;	/* return 1 to prevent further search processing */
-	}
-	slapi_ch_free((void**)&referral);
-bail:
-	return return_code;
-}
diff --git a/ldap/servers/plugins/replication/repl_connext.c b/ldap/servers/plugins/replication/repl_connext.c
index 164ff51..adf6642 100644
--- a/ldap/servers/plugins/replication/repl_connext.c
+++ b/ldap/servers/plugins/replication/repl_connext.c
@@ -35,7 +35,6 @@ void* consumer_connection_extension_constructor (void *object, void *parent)
 	}
 	else
 	{
-	    ext->is_legacy_replication_dn= 0;
 		ext->repl_protocol_version = REPL_PROTOCOL_UNKNOWN;
 		ext->replica_acquired = NULL;
 		ext->isreplicationsession= 0;
diff --git a/ldap/servers/plugins/replication/repl_delete.c b/ldap/servers/plugins/replication/repl_delete.c
deleted file mode 100644
index 6419cc4..0000000
--- a/ldap/servers/plugins/replication/repl_delete.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
- 
-#include "slapi-plugin.h"
-#include "repl.h"
-
-int
-legacy_preop_delete( Slapi_PBlock *pb )
-{
-	return legacy_preop(pb, "legacy_preop_delete", OP_DELETE);
-}
-
-int
-legacy_bepreop_delete( Slapi_PBlock *pb )
-{
-	return 0; /* OK */
-}
-
-int
-legacy_postop_delete( Slapi_PBlock *pb )
-{
-	return legacy_postop(pb, "legacy_preop_delete", OP_DELETE);
-}
diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c
index d2ed59c..c5b334b 100644
--- a/ldap/servers/plugins/replication/repl_extop.c
+++ b/ldap/servers/plugins/replication/repl_extop.c
@@ -773,13 +773,6 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 		}
 	}
 
-    /* check that this replica is not a 4.0 consumer */
-    if (replica_is_legacy_consumer (replica))
-    {
-        response = NSDS50_REPL_LEGACY_CONSUMER;
-        goto send_response;
-    }
-
 	/* Check that bind dn is authorized to supply replication updates */
 	slapi_pblock_get(pb, SLAPI_CONN_DN, &bind_dn); /* bind_dn is allocated */
 	bind_sdn = slapi_sdn_new_dn_passin(bind_dn);
diff --git a/ldap/servers/plugins/replication/repl_init.c b/ldap/servers/plugins/replication/repl_init.c
deleted file mode 100644
index ed5f575..0000000
--- a/ldap/servers/plugins/replication/repl_init.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-
-/*
- * Add an entry like the following to dse.ldif to enable this plugin:
-
-dn: cn=Legacy Replication Plugin,cn=plugins,cn=config
-objectclass: top
-objectclass: nsSlapdPlugin
-objectclass: extensibleObject
-cn: Legacy Replication Plugin
-nsslapd-pluginpath: /export2/servers/Hydra-supplier/lib/replication-plugin.so
-nsslapd-plugininitfunc: replication_legacy_plugin_init
-nsslapd-plugintype: object
-nsslapd-pluginenabled: on
-nsslapd-plugin-depends-on-type: database
-nsslapd-plugin-depends-on-named: Class of Service
-nsslapd-plugin-depends-on-named: Multi-Master Replication Plugin
-nsslapd-pluginid: replication-legacy
-nsslapd-pluginversion: 5.0b1
-nsslapd-pluginvendor: Netscape Communications
-nsslapd-plugindescription: Legacy Replication Plugin
-
-NOTE: This plugin depends on the Multi-Master Replication Plugin
-
-*/
- 
-#include "slapi-plugin.h"
-#include "repl.h"
-#include "repl5.h"
-#include "repl_shared.h"
-#include "cl4.h"	/* changelog interface */
-
-
-/* ----------------------------- Legacy Replication Plugin */
-
-static Slapi_PluginDesc legacydesc = { "replication-legacy", VENDOR, DS_PACKAGE_VERSION, "Legacy Replication Plugin" };
-static Slapi_PluginDesc legacypreopdesc = { "replication-legacy-preop", VENDOR, DS_PACKAGE_VERSION, "Legacy replication pre-operation plugin" };
-static Slapi_PluginDesc legacypostopdesc = { "replication-legacy-postop", VENDOR, DS_PACKAGE_VERSION, "Legacy replication post-operation plugin" };
-static Slapi_PluginDesc legacyinternalpreopdesc = { "replication-legacy-internalpreop", VENDOR, DS_PACKAGE_VERSION, "Legacy replication internal pre-operation plugin" };
-static Slapi_PluginDesc legacyinternalpostopdesc = { "replication-legacy-internalpostop", VENDOR, DS_PACKAGE_VERSION, "Legacy replication internal post-operation plugin" };
-static Slapi_PluginDesc legacyentrydesc = { "replication-legacy-entry", VENDOR, DS_PACKAGE_VERSION, "Legacy replication entry plugin" };
-
-static int legacy_stopped; /* A flag which is set when all the plugin threads are to stop */        
-
-
-/* Initialize preoperation plugin points */
-int
-legacy_preop_init( Slapi_PBlock *pb )
-{
-    int rc= 0; /* OK */
-
-	if( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,	SLAPI_PLUGIN_VERSION_01 ) != 0 || 
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&legacypreopdesc ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_BIND_FN, (void *) legacy_preop_bind ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_ADD_FN, (void *) legacy_preop_add ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_DELETE_FN, (void *) legacy_preop_delete ) != 0 ||
-		slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_MODIFY_FN, (void *) legacy_preop_modify ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_MODRDN_FN, (void *) legacy_preop_modrdn ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_SEARCH_FN, (void *) legacy_preop_search ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_COMPARE_FN, (void *) legacy_preop_compare ) != 0 ||
-		slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_ENTRY_FN, (void *) legacy_pre_entry ))
-	{
-		slapi_log_error( SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_preop_init failed\n" );
-		rc= -1;
-	}
-	return rc;
-}
-
-
-
-/* Initialize postoperation plugin points */
-static int
-legacy_postop_init( Slapi_PBlock *pb )
-{
-    int rc= 0; /* OK */
-
-	if( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,	SLAPI_PLUGIN_VERSION_01 ) != 0 || 
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&legacypostopdesc ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_POST_ADD_FN, (void *) legacy_postop_add ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_POST_DELETE_FN, (void *) legacy_postop_delete ) != 0 ||
-		slapi_pblock_set( pb, SLAPI_PLUGIN_POST_MODIFY_FN, (void *) legacy_postop_modify ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_POST_MODRDN_FN, (void *) legacy_postop_modrdn ) != 0 )
-	{
-		slapi_log_error( SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_postop_init failed\n" );
-		rc= -1;
-	}
-
-	return rc;
-}
-
-
-
-/* Initialize internal preoperation plugin points (called for internal operations) */
-static int
-legacy_internalpreop_init( Slapi_PBlock *pb )
-{
-    int rc= 0; /* OK */
-	
-	if( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,	SLAPI_PLUGIN_VERSION_01 ) != 0 || 
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&legacyinternalpreopdesc ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_PRE_ADD_FN, (void *) legacy_preop_add ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_PRE_DELETE_FN, (void *) legacy_preop_delete ) != 0 ||
-		slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_PRE_MODIFY_FN, (void *) legacy_preop_modify ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_PRE_MODRDN_FN, (void *) legacy_preop_modrdn ) != 0 )
-	{
-		slapi_log_error( SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_internalpreop_init failed\n" );
-		rc= -1;
-	}
-	return rc;
-}
-
-
-
-/* Initialize internal postoperation plugin points (called for internal operations) */
-static int
-legacy_internalpostop_init( Slapi_PBlock *pb )
-{
-    int rc= 0; /* OK */
-
-	if( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,	SLAPI_PLUGIN_VERSION_01 ) != 0 || 
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&legacyinternalpostopdesc ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_ADD_FN, (void *) legacy_postop_add ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN, (void *) legacy_postop_delete ) != 0 ||
-		slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_MODIFY_FN, (void *) legacy_postop_modify ) != 0 ||
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN, (void *) legacy_postop_modrdn ) != 0 )
-	{
-		slapi_log_error( SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_internalpostop_init failed\n" );
-		rc= -1;
-	}
-
-	return rc;
-}
-
-
-
-/* Initialize the entry plugin point for the legacy replication plugin */
-static int
-legacy_entry_init( Slapi_PBlock *pb )
-{
-    int rc= 0; /* OK */
-	
-	/* Set up the fn pointers for the preop and postop operations we're interested in */
-	if( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,	SLAPI_PLUGIN_VERSION_01 ) != 0 || 
-	    slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&legacyentrydesc ) != 0 )
-	{
-		slapi_log_error( SLAPI_LOG_PLUGIN, repl_plugin_name, "legacy_entry_init failed\n" );
-		rc= -1;
-	}
-	return rc;
-}
-
-
-
-
-/*
- * Create the entry at the top of the replication configuration subtree.
- */
-static int
-create_config_top()
-{
-	/* DN part of this entry_string: no need to be optimized. */
-	char *entry_string = slapi_ch_strdup("dn: cn=replication,cn=config\nobjectclass: top\nobjectclass: extensibleobject\ncn: replication\n");
-	Slapi_PBlock *pb = slapi_pblock_new();
-	Slapi_Entry *e = slapi_str2entry(entry_string, 0);
-	int return_value;
-
-	slapi_add_entry_internal_set_pb(pb, e, NULL, /* controls */
-		repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION), 0 /* flags */);
-	slapi_add_internal_pb(pb);
-	slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &return_value);
-	slapi_pblock_destroy(pb);
-	slapi_ch_free((void **)&entry_string);
-	return return_value;
-}
-
-
-/* Start the legacy replication plugin */
-static int 
-legacy_start( Slapi_PBlock *pb )
-{
-	static int legacy_started = 0;
-    int rc= 0; /* OK */
-
-    if (!legacy_started)
-	{
-		int ctrc;
-
-		/* Initialise support for cn=monitor */
-		repl_monitor_init();
-
-		/* Initialise support for "" (the rootdse) */
-		/* repl_rootdse_init(); */
-
-		/* Decode the command line args to see if we're dumping to LDIF */
-		{
-			int argc;
-			char **argv;
-			slapi_pblock_get( pb, SLAPI_ARGC, &argc);
-			slapi_pblock_get( pb, SLAPI_ARGV, &argv);
-			repl_entry_init(argc,argv);
-		}
-
-		/* Create the entry at the top of the config area, if it doesn't exist */
-		/* XXXggood this should be in the 5.0 plugin! */
-		ctrc = create_config_top();
-		if (ctrc != LDAP_SUCCESS && ctrc != LDAP_ALREADY_EXISTS)
-		{
-			slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: unable to "
-				"create configuration entry %s: %s\n", REPL_CONFIG_TOP,
-				ldap_err2string(ctrc));
-		}
-		(void)legacy_consumer_config_init();
-
-        /* register to be notified when backend state changes */
-        slapi_register_backend_state_change((void *)legacy_consumer_be_state_change, 
-                                            legacy_consumer_be_state_change);
-
-		legacy_started = 1;
-		legacy_stopped = 0;
-	}
-    return rc;
-}
-
-
-/* Post-start function for the legacy replication plugin */
-static int
-legacy_poststart( Slapi_PBlock *pb )
-{
-    int rc = 0; /* OK */
-    return rc;
-}
-
-
-/* Stop the legacy replication plugin */
-static int
-legacy_stop( Slapi_PBlock *pb )
-{
-    int rc= 0; /* OK */
-
-    if (!legacy_stopped)
-	{
-        /*csnShutdown();*/
-    	legacy_stopped = 1;
-	}
-	 
-    /* unregister backend state change notification */
-    slapi_unregister_backend_state_change((void *)legacy_consumer_be_state_change);
-	
-    return rc;
-}
-
-
-/* Initialize the legacy replication plugin */
-int
-replication_legacy_plugin_init(Slapi_PBlock *pb)
-{
-    static int legacy_initialised= 0;
-    int rc= 0; /* OK */
-	void *identity = NULL;
-
-	slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &identity);
-	PR_ASSERT (identity);
-	repl_set_plugin_identity (PLUGIN_LEGACY_REPLICATION, identity);
-
-	if(rc==0 && !legacy_initialised)
-	{
-	    rc= slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 );
-	    rc= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&legacydesc );
-	    rc= slapi_pblock_set( pb, SLAPI_PLUGIN_START_FN, (void *) legacy_start );
-	    rc= slapi_pblock_set( pb, SLAPI_PLUGIN_CLOSE_FN, (void *) legacy_stop );
-	    rc= slapi_pblock_set( pb, SLAPI_PLUGIN_POSTSTART_FN, (void *) legacy_poststart );
-		
-		/* Register the plugin interfaces we implement */
-        rc= slapi_register_plugin("preoperation", 1 /* Enabled */, "legacy_preop_init", legacy_preop_init, "Legacy replication preoperation plugin", NULL, identity);
-        rc= slapi_register_plugin("postoperation", 1 /* Enabled */, "legacy_postop_init", legacy_postop_init, "Legacy replication postoperation plugin", NULL, identity);
-        rc= slapi_register_plugin("internalpreoperation", 1 /* Enabled */, "legacy_internalpreop_init", legacy_internalpreop_init, "Legacy replication internal preoperation plugin", NULL,  identity);
-        rc= slapi_register_plugin("internalpostoperation", 1 /* Enabled */, "legacy_internalpostop_init", legacy_internalpostop_init, "Legacy replication internal postoperation plugin", NULL,  identity);		
-		rc= slapi_register_plugin("entry", 1 /* Enabled */, "legacy_entry_init", legacy_entry_init, "Legacy replication entry plugin", NULL, identity);
-		
-		legacy_initialised= 1;
-	}
-	return rc;
-}
-
-
-int
-get_legacy_stop()
-{
-    return legacy_stopped;
-}
diff --git a/ldap/servers/plugins/replication/repl_modify.c b/ldap/servers/plugins/replication/repl_modify.c
deleted file mode 100644
index d429508..0000000
--- a/ldap/servers/plugins/replication/repl_modify.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
- 
-#include "slapi-plugin.h"
-#include "repl.h"
-
-/* The modify operation plugin functions for the legacy replication plugin */
-
-int
-legacy_preop_modify( Slapi_PBlock *pb )
-{
-    return legacy_preop( pb, "legacy_preop_modify", OP_MODIFY );
-}
-
-int
-legacy_bepreop_modify( Slapi_PBlock *pb )
-{
-    int rc= 0; /* OK */
-    return rc;
-}
-
-int
-legacy_postop_modify( Slapi_PBlock *pb )
-{
-    return legacy_postop( pb, "legacy_postop_modify", OP_MODIFY );
-}
diff --git a/ldap/servers/plugins/replication/repl_modrdn.c b/ldap/servers/plugins/replication/repl_modrdn.c
deleted file mode 100644
index 0ee8c6b..0000000
--- a/ldap/servers/plugins/replication/repl_modrdn.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
- 
-#include "slapi-plugin.h"
-#include "repl.h"
-
-/* The modrdn plugin points for the legacy replication plugin */
-
-int
-legacy_preop_modrdn( Slapi_PBlock *pb )
-{
-	return legacy_preop(pb, "legacy_preop_modrdn", OP_MODDN);
-}
-
-int
-legacy_bepreop_modrdn( Slapi_PBlock *pb )
-{
-    return 0; /* OK */
-}
-
-int
-legacy_postop_modrdn( Slapi_PBlock *pb )
-{
-	return legacy_postop(pb, "legacy_postop_modrdn", OP_MODDN);
-}
diff --git a/ldap/servers/plugins/replication/repl_opext.c b/ldap/servers/plugins/replication/repl_opext.c
index 7f09507..f6c8eec 100644
--- a/ldap/servers/plugins/replication/repl_opext.c
+++ b/ldap/servers/plugins/replication/repl_opext.c
@@ -70,11 +70,6 @@ void* consumer_operation_extension_constructor (void *object, void *parent)
 			{
 				operation_set_flag((Slapi_Operation *)object,OP_FLAG_REPLICATED);
 			}
-			/* We set the Replication DN flag if session bound as replication dn */ 
-			if (connext->is_legacy_replication_dn)
-			{
-				operation_set_flag((Slapi_Operation *)object, OP_FLAG_LEGACY_REPLICATION_DN);
-			}
 		}
 	}
 	else
diff --git a/ldap/servers/plugins/replication/repl_ops.c b/ldap/servers/plugins/replication/repl_ops.c
deleted file mode 100644
index 7a8c5d6..0000000
--- a/ldap/servers/plugins/replication/repl_ops.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-
-#include "slapi-plugin.h"
-#include "repl.h"
-#include "repl5.h"
-
-int
-legacy_postop( Slapi_PBlock *pb, const char *caller, int operation_type)
-{
-	int rc = 0;
-    Object *r_obj;
-    Replica *r;
-	
-    r_obj = replica_get_replica_for_op (pb);
-    if (r_obj == NULL)  /* there is no replica configured for this operations */
-        return 0;
-    else
-    {
-        /* check if this replica is 4.0 consumer */
-        r = (Replica*)object_get_data (r_obj);
-        PR_ASSERT (r);
-
-        /* this replica is not a 4.0 consumer - so we don't need to do any processing */
-        if (!replica_is_legacy_consumer (r))
-        {
-            object_release (r_obj);
-            return 0;
-        }
-    
-        object_release (r_obj);
-    }
-
-	slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &rc);
-	if (0 == rc)
-	{
-		if (OP_ADD == operation_type || OP_MODIFY == operation_type)
-		{
-			void *op;
-			consumer_operation_extension *opext = NULL;
-
-			/* Optimise out traversal of mods/entry if no cop{ied|ying}From present */
-			slapi_pblock_get(pb, SLAPI_OPERATION, &op);
-			opext = (consumer_operation_extension*) repl_con_get_ext (REPL_CON_EXT_OP, op);
-			if (NULL != opext && opext->has_cf)
-			{
-                process_legacy_cf( pb );
-			}
-		}
-	}
-
-	return 0;
-}
-
-int
-legacy_preop(Slapi_PBlock *pb, const char *caller, int operation_type)
-{
-	int rc = 0;
-	Slapi_Operation *operation = NULL;
-	consumer_operation_extension *opext = NULL;
-	int has_cf = 0;
-	Object *r_obj;
-	Replica *r;
-	int is_legacy_op = 0;
-
-	slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
-	if (NULL == operation) {
-		slapi_send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL, 
-		                       "Null replication operation is given", 0, NULL);
-		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
-		                "Null replication operation is given\n");
-		return -1;
-	}
-	is_legacy_op = operation_is_flag_set(operation,OP_FLAG_LEGACY_REPLICATION_DN);
-	r_obj = replica_get_replica_for_op (pb);
-
-	if (r_obj == NULL) {  /* there is no replica configured for this operations */
-		if (is_legacy_op){
-			/* This is a legacy replication operation but there are NO replica defined
-			   Just refuse it */
-			slapi_send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL, 
-				"Replication operation refused because the consumer is not defined as a replica", 0, NULL);
-			slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
-				"Incoming replication operation was refused because "
-				"there's no replica defined for this operation\n");
-			return -1;
-		}
-		else {
-			return 0;
-		}
-	}
-    else
-    {
-        /* check if this replica is 4.0 consumer */
-        r = (Replica*)object_get_data (r_obj);
-        PR_ASSERT (r);
-
-        if (!replica_is_legacy_consumer (r))
-        {
-            object_release (r_obj);
-			if (is_legacy_op) {
-				/* This is a legacy replication operation 
-				   but the replica is doesn't accept from legacy
-				   Just refuse it */
-				slapi_send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL, 
-					"Replication operation refused because "
-					"the consumer is not defined as a legacy replica", 0, NULL);
-				slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
-					"Incoming replication operation was refused because "
-					"there's no legacy replica defined for this operation\n");
-				return -1;
-			} else {
-				return 0;
-			}
-        }
-
-        object_release (r_obj);
-    }
-
-	opext = (consumer_operation_extension*) repl_con_get_ext (REPL_CON_EXT_OP, operation);
-	
-	switch (operation_type) {
-	case OP_ADD:
-		{
-			Slapi_Entry *e = NULL;
-			Slapi_Attr *attr;
-			/*
-			 * Check if the entry being added has copiedFrom/copyingFrom
-			 * attributes. 
-			 */
-			slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &e);
-			if (NULL != e)
-			{
-				if (slapi_entry_attr_find(e, type_copiedFrom, &attr) == 0)
-				{
-					has_cf = 1;
-				}
-				else
-				if (slapi_entry_attr_find(e, type_copyingFrom, &attr) == 0)
-				{
-					has_cf = 1;
-				}
-			}
-			/* JCMREPL - If this is a replicated operation then the baggage control also contains the Unique Identifier of the superior entry. */
-		}
-		break;
-	case OP_MODIFY:
-		{
-			LDAPMod **mods = NULL;
-			int i;
-	
-			/*
-			 * Check if the modification contains copiedFrom/copyingFrom
-			 * attributes. 
-			 */
-			slapi_pblock_get(pb, SLAPI_MODIFY_MODS, &mods);
-			for (i = 0; NULL != mods && NULL != mods[i]; i++)
-			{
-				if ((strcasecmp(mods[i]->mod_type, type_copiedFrom) == 0) ||
-						(strcasecmp(mods[i]->mod_type, type_copyingFrom) == 0))
-				{
-					has_cf = 1;
-				}
-			}
-		}
-		break;
-	case OP_DELETE:
-		break;
-	case OP_MODDN:
-		break;
-	}
-
-	/* Squirrel away an optimization hint for the postop plugin */
-	opext->has_cf = has_cf;
-
-	return rc;
-}
diff --git a/ldap/servers/plugins/replication/repl_rootdse.c b/ldap/servers/plugins/replication/repl_rootdse.c
index a9854cd..530840b 100644
--- a/ldap/servers/plugins/replication/repl_rootdse.c
+++ b/ldap/servers/plugins/replication/repl_rootdse.c
@@ -15,7 +15,6 @@
 #include <string.h>
 
 #include "repl.h"
-#include "cl4.h"
 #include "slapi-plugin.h"
  
 /* Forward Declartions */
diff --git a/ldap/servers/plugins/replication/repl_search.c b/ldap/servers/plugins/replication/repl_search.c
deleted file mode 100644
index 2ad2337..0000000
--- a/ldap/servers/plugins/replication/repl_search.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- *
- * License: GPL (version 3 or any later version).
- * See LICENSE for details. 
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
- 
-#include "slapi-plugin.h"
-#include "repl.h"
-
-/* XXXggood I think we no longer need this - the mapping tree should do it for us */
-int
-legacy_preop_search( Slapi_PBlock *pb )
-{
-	int return_code = 0;
-	return return_code;
-}
-
-
-/* XXXggood I think we no longer need this - the mapping tree should do it for us */
-int
-legacy_pre_entry( Slapi_PBlock *pb )
-{
-	int return_code = 0;
-	return return_code;
-}
-- 
2.4.3

