s4:cluster: remove old/broken ctdb code
authorStefan Metzmacher <metze@samba.org>
Mon, 29 Dec 2008 10:02:32 +0000 (11:02 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 29 Dec 2008 13:46:09 +0000 (14:46 +0100)
We don't need a full copy of ctdb...
If we want to readd cluster support,
we should just use a ctdb client library.

metze

97 files changed:
source3/samba4.mk
source4/cluster/config.mk
source4/cluster/ctdb/Makefile.in [deleted file]
source4/cluster/ctdb/aclocal.m4 [deleted file]
source4/cluster/ctdb/autogen.sh [deleted file]
source4/cluster/ctdb/brlock_ctdb.c [deleted file]
source4/cluster/ctdb/client/ctdb_client.c [deleted file]
source4/cluster/ctdb/common/cmdline.c [deleted file]
source4/cluster/ctdb/common/ctdb_io.c [deleted file]
source4/cluster/ctdb/common/ctdb_ltdb.c [deleted file]
source4/cluster/ctdb/common/ctdb_message.c [deleted file]
source4/cluster/ctdb/common/ctdb_util.c [deleted file]
source4/cluster/ctdb/common/system.c [deleted file]
source4/cluster/ctdb/config.guess [deleted file]
source4/cluster/ctdb/config.h.in [deleted file]
source4/cluster/ctdb/config.mk [deleted file]
source4/cluster/ctdb/config.sub [deleted file]
source4/cluster/ctdb/configure.ac [deleted file]
source4/cluster/ctdb/ctdb_cluster.c [deleted file]
source4/cluster/ctdb/ctdb_cluster.h [deleted file]
source4/cluster/ctdb/doc/ctdb.1 [deleted file]
source4/cluster/ctdb/doc/ctdb.1.html [deleted file]
source4/cluster/ctdb/doc/ctdb.1.xml [deleted file]
source4/cluster/ctdb/doc/ctdbd.1 [deleted file]
source4/cluster/ctdb/doc/ctdbd.1.html [deleted file]
source4/cluster/ctdb/doc/ctdbd.1.xml [deleted file]
source4/cluster/ctdb/doc/onnode.1 [deleted file]
source4/cluster/ctdb/doc/onnode.1.html [deleted file]
source4/cluster/ctdb/doc/onnode.1.xml [deleted file]
source4/cluster/ctdb/example/cluster_start.sh [deleted file]
source4/cluster/ctdb/example/howto.txt [deleted file]
source4/cluster/ctdb/example/nlist.txt [deleted file]
source4/cluster/ctdb/example/smb.conf.cluster [deleted file]
source4/cluster/ctdb/example/smb.conf.node1 [deleted file]
source4/cluster/ctdb/example/smb.conf.node2 [deleted file]
source4/cluster/ctdb/example/unclist.txt [deleted file]
source4/cluster/ctdb/ib/README.txt [deleted file]
source4/cluster/ctdb/ib/config.m4 [deleted file]
source4/cluster/ctdb/ib/ibw_ctdb.c [deleted file]
source4/cluster/ctdb/ib/ibw_ctdb.h [deleted file]
source4/cluster/ctdb/ib/ibw_ctdb_init.c [deleted file]
source4/cluster/ctdb/ib/ibwrapper.c [deleted file]
source4/cluster/ctdb/ib/ibwrapper.h [deleted file]
source4/cluster/ctdb/ib/ibwrapper_internal.h [deleted file]
source4/cluster/ctdb/ib/ibwrapper_test.c [deleted file]
source4/cluster/ctdb/include/cmdline.h [deleted file]
source4/cluster/ctdb/include/ctdb.h [deleted file]
source4/cluster/ctdb/include/ctdb_private.h [deleted file]
source4/cluster/ctdb/include/idtree.h [deleted file]
source4/cluster/ctdb/include/includes.h [deleted file]
source4/cluster/ctdb/install-sh [deleted file]
source4/cluster/ctdb/opendb_ctdb.c [deleted file]
source4/cluster/ctdb/packaging/RHEL/ctdb.spec [deleted file]
source4/cluster/ctdb/packaging/RHEL/makerpms.sh [deleted file]
source4/cluster/ctdb/packaging/RHEL/setup/ctdb.init [deleted file]
source4/cluster/ctdb/packaging/RHEL/setup/ctdb.sysconfig [deleted file]
source4/cluster/ctdb/packaging/RPM/ctdb.spec [deleted file]
source4/cluster/ctdb/packaging/RPM/makerpms.sh [deleted file]
source4/cluster/ctdb/server/ctdb_call.c [deleted file]
source4/cluster/ctdb/server/ctdb_control.c [deleted file]
source4/cluster/ctdb/server/ctdb_daemon.c [deleted file]
source4/cluster/ctdb/server/ctdb_freeze.c [deleted file]
source4/cluster/ctdb/server/ctdb_lockwait.c [deleted file]
source4/cluster/ctdb/server/ctdb_ltdb_server.c [deleted file]
source4/cluster/ctdb/server/ctdb_monitor.c [deleted file]
source4/cluster/ctdb/server/ctdb_recover.c [deleted file]
source4/cluster/ctdb/server/ctdb_recoverd.c [deleted file]
source4/cluster/ctdb/server/ctdb_server.c [deleted file]
source4/cluster/ctdb/server/ctdb_takeover.c [deleted file]
source4/cluster/ctdb/server/ctdb_traverse.c [deleted file]
source4/cluster/ctdb/server/ctdb_tunables.c [deleted file]
source4/cluster/ctdb/server/ctdbd.c [deleted file]
source4/cluster/ctdb/server/eventscript.c [deleted file]
source4/cluster/ctdb/takeover/ctdb_takeover.c [deleted file]
source4/cluster/ctdb/takeover/system.c [deleted file]
source4/cluster/ctdb/tcp/ctdb_tcp.h [deleted file]
source4/cluster/ctdb/tcp/tcp_connect.c [deleted file]
source4/cluster/ctdb/tcp/tcp_init.c [deleted file]
source4/cluster/ctdb/tcp/tcp_io.c [deleted file]
source4/cluster/ctdb/tests/bench.sh [deleted file]
source4/cluster/ctdb/tests/ctdb_bench.c [deleted file]
source4/cluster/ctdb/tests/ctdb_fetch.c [deleted file]
source4/cluster/ctdb/tests/ctdb_store.c [deleted file]
source4/cluster/ctdb/tests/ctdbd.sh [deleted file]
source4/cluster/ctdb/tests/events [deleted file]
source4/cluster/ctdb/tests/fetch.sh [deleted file]
source4/cluster/ctdb/tests/nodes.txt [deleted file]
source4/cluster/ctdb/tests/public_addresses [deleted file]
source4/cluster/ctdb/tests/recover.sh [deleted file]
source4/cluster/ctdb/tests/run_tests.sh [deleted file]
source4/cluster/ctdb/tests/start_daemons.sh [deleted file]
source4/cluster/ctdb/tools/ctdb.c [deleted file]
source4/cluster/ctdb/tools/onnode.rsh [deleted file]
source4/cluster/ctdb/tools/onnode.ssh [deleted file]
source4/ntvfs/common/config.mk
source4/ntvfs/common/opendb.c
source4/smbd/server.c

index c79694edb0ad4f5bcc83dcd76b1f1ac2a90dd93e..9848cce46dafaa6ed621d6a43c0433a360d46559 100644 (file)
@@ -70,7 +70,6 @@ dynconfigsrcdir := $(samba4srcdir)/dynconfig
 heimdalsrcdir := $(samba4srcdir)/heimdal
 dsdbsrcdir := $(samba4srcdir)/dsdb
 smbdsrcdir := $(samba4srcdir)/smbd
-clustersrcdir := $(samba4srcdir)/cluster
 libnetsrcdir := $(samba4srcdir)/libnet
 authsrcdir := $(samba4srcdir)/auth
 nsswitchsrcdir := $(samba4srcdir)/../nsswitch
index e841956a0c07671b8c0c4e3b554a42568e087967..3dae74933c07fb0172b7b477a40ef3b06557f021 100644 (file)
@@ -1,7 +1,3 @@
-ctdbsrcdir = $(clustersrcdir)/ctdb
-mkinclude ctdb/config.mk
-
 [SUBSYSTEM::CLUSTER]
-PRIVATE_DEPENDENCIES = ctdb
 
 CLUSTER_OBJ_FILES = $(addprefix $(clustersrcdir)/, cluster.o local.o)
diff --git a/source4/cluster/ctdb/Makefile.in b/source4/cluster/ctdb/Makefile.in
deleted file mode 100644 (file)
index 2891a22..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-#!gmake
-#
-CC = @CC@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datarootdir = @datarootdir@
-includedir = @includedir@
-libdir = @libdir@
-bindir = @bindir@
-sbindir = @sbindir@
-mandir = @mandir@
-localstatedir = @localstatedir@
-VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@
-srcdir = @srcdir@
-etcdir = @sysconfdir@
-builddir = @builddir@
-DESTDIR = /
-EXTRA_OBJ=@EXTRA_OBJ@
-XSLTPROC = /usr/bin/xsltproc
-INSTALLCMD = @INSTALL@
-
-POPT_LIBS = @POPT_LIBS@
-POPT_CFLAGS = @POPT_CFLAGS@
-POPT_OBJ = @POPT_OBJ@
-
-CFLAGS=-g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir) \
-       -I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
-       -DVARDIR=\"$(localstatedir)\" -DETCDIR=\"$(etcdir)\" \
-       -DUSE_MMAP=1 @CFLAGS@ $(POPT_CFLAGS)
-
-LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ $(POPT_LIBS) @INFINIBAND_LIBS@
-
-UTIL_OBJ = lib/util/idtree.o lib/util/db_wrap.o lib/util/strlist.o lib/util/util.o \
-       lib/util/util_time.o lib/util/util_file.o
-
-CTDB_COMMON_OBJ =  common/ctdb_io.o common/ctdb_util.o \
-       common/ctdb_ltdb.o common/ctdb_message.o common/cmdline.o  \
-       lib/util/debug.o common/system.o
-
-CTDB_TCP_OBJ = tcp/tcp_connect.o tcp/tcp_io.o tcp/tcp_init.o
-
-CTDB_CLIENT_OBJ = client/ctdb_client.o \
-       $(CTDB_COMMON_OBJ) $(POPT_OBJ) $(UTIL_OBJ) @TALLOC_OBJ@ @TDB_OBJ@ \
-       @LIBREPLACEOBJ@ $(EXTRA_OBJ) @EVENTS_OBJ@ 
-
-CTDB_SERVER_OBJ = server/ctdbd.o server/ctdb_daemon.o server/ctdb_lockwait.o \
-       server/ctdb_recoverd.o server/ctdb_recover.o server/ctdb_freeze.o \
-       server/ctdb_tunables.o server/ctdb_monitor.o server/ctdb_server.o \
-       server/ctdb_control.o server/ctdb_call.o server/ctdb_ltdb_server.o \
-       server/ctdb_traverse.o server/eventscript.o server/ctdb_takeover.o \
-       $(CTDB_CLIENT_OBJ) $(CTDB_TCP_OBJ) @INFINIBAND_WRAPPER_OBJ@
-
-TEST_BINS=bin/ctdb_bench bin/ctdb_fetch bin/ctdb_store @INFINIBAND_BINS@
-BINS = bin/ctdb bin/scsi_io
-SBINS = bin/ctdbd
-
-DIRS = lib bin
-
-.SUFFIXES: .c .o .h .1 .1.xml .1.html
-
-all: showflags dirs doc $(CTDB_SERVER_OBJ) $(CTDB_CLIENT_OBJ) $(BINS) $(SBINS) $(TEST_BINS)
-
-showflags:
-       @echo 'ctdb will be compiled with flags:'
-       @echo '  CFLAGS = $(CFLAGS)'
-       @echo '  LIBS = $(LIBS)'
-
-.c.o:
-       @echo Compiling $*.c
-       @mkdir -p `dirname $@`
-       @$(CC) $(CFLAGS) -c $< -o $@
-
-dirs:
-       @mkdir -p $(DIRS)
-
-bin/ctdbd: $(CTDB_SERVER_OBJ)
-       @echo Linking $@
-       @$(CC) $(CFLAGS) -o $@ $(CTDB_SERVER_OBJ) $(LIB_FLAGS)
-
-bin/scsi_io: $(CTDB_CLIENT_OBJ) scsi/scsi_io.o 
-       @echo Linking $@
-       @$(CC) $(CFLAGS) -o $@ scsi/scsi_io.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
-
-bin/ctdb: $(CTDB_CLIENT_OBJ) tools/ctdb.o 
-       @echo Linking $@
-       @$(CC) $(CFLAGS) -o $@ tools/ctdb.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
-
-bin/ctdb_bench: $(CTDB_CLIENT_OBJ) tests/ctdb_bench.o 
-       @echo Linking $@
-       @$(CC) $(CFLAGS) -o $@ tests/ctdb_bench.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
-
-bin/ctdb_fetch: $(CTDB_CLIENT_OBJ) tests/ctdb_fetch.o 
-       @echo Linking $@
-       @$(CC) $(CFLAGS) -o $@ tests/ctdb_fetch.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
-
-bin/ctdb_store: $(CTDB_CLIENT_OBJ) tests/ctdb_store.o 
-       @echo Linking $@
-       @$(CC) $(CFLAGS) -o $@ tests/ctdb_store.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
-
-bin/ibwrapper_test: $(CTDB_CLIENT_OBJ) ib/ibwrapper_test.o
-       @echo Linking $@
-       @$(CC) $(CFLAGS) -o $@ ib/ibwrapper_test.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
-
-.1.xml.1:
-       -test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
-
-.1.xml.1.html:
-       -test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
-
-doc: doc/ctdb.1 doc/ctdb.1.html \
-       doc/ctdbd.1 doc/ctdbd.1.html \
-       doc/onnode.1 doc/onnode.1.html
-
-clean:
-       rm -f *.o */*.o */*/*.o */*~
-       rm -f $(BINS) $(SBINS) $(TEST_BINS)
-
-distclean: clean
-       rm -f *~ */*~
-       rm -rf bin
-       rm -f config.log config.status config.cache config.h
-       rm -f Makefile
-
-install: all
-       mkdir -p $(DESTDIR)$(bindir)
-       mkdir -p $(DESTDIR)$(sbindir)
-       mkdir -p $(DESTDIR)$(includedir)
-       mkdir -p $(DESTDIR)$(etcdir)/ctdb
-       mkdir -p $(DESTDIR)$(etcdir)/ctdb/events.d
-       ${INSTALLCMD} -m 755 bin/ctdb $(DESTDIR)$(bindir)
-       ${INSTALLCMD} -m 755 bin/ctdbd $(DESTDIR)$(sbindir)
-       ${INSTALLCMD} -m 644 include/ctdb.h $(DESTDIR)$(includedir)
-       ${INSTALLCMD} -m 644 include/ctdb_private.h $(DESTDIR)$(includedir) # for samba3
-       ${INSTALLCMD} -m 755 config/events $(DESTDIR)$(etcdir)/ctdb
-       ${INSTALLCMD} -m 755 config/functions $(DESTDIR)$(etcdir)/ctdb
-       ${INSTALLCMD} -m 755 config/statd-callout $(DESTDIR)$(etcdir)/ctdb
-       ${INSTALLCMD} -m 755 config/events.d/10.interface $(DESTDIR)$(etcdir)/ctdb/events.d
-       ${INSTALLCMD} -m 755 config/events.d/40.vsftpd $(DESTDIR)$(etcdir)/ctdb/events.d
-       ${INSTALLCMD} -m 755 config/events.d/50.samba $(DESTDIR)$(etcdir)/ctdb/events.d
-       ${INSTALLCMD} -m 755 config/events.d/60.nfs $(DESTDIR)$(etcdir)/ctdb/events.d
-       ${INSTALLCMD} -m 755 config/events.d/61.nfstickle $(DESTDIR)$(etcdir)/ctdb/events.d
-       ${INSTALLCMD} -m 755 tools/onnode.ssh $(DESTDIR)$(bindir)
-       ${INSTALLCMD} -m 755 tools/onnode.rsh $(DESTDIR)$(bindir)
-       if [ -f doc/ctdb.1 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man1; fi
-       if [ -f doc/ctdb.1 ];then ${INSTALLCMD} -m 644 doc/ctdb.1 $(DESTDIR)$(mandir)/man1; fi
-       if [ -f doc/ctdbd.1 ];then ${INSTALLCMD} -m 644 doc/ctdbd.1 $(DESTDIR)$(mandir)/man1; fi
-       if [ -f doc/onnode.1 ];then ${INSTALLCMD} -m 644 doc/onnode.1 $(DESTDIR)$(mandir)/man1; fi
-       cd $(DESTDIR)$(bindir) && ln -sf onnode.ssh onnode
-
-test: all
-       tests/run_tests.sh
-
-valgrindtest: all
-       VALGRIND="valgrind -q --trace-children=yes" tests/run_tests.sh
-
-
-realdistclean: distclean
-       rm -f configure config.h.in
diff --git a/source4/cluster/ctdb/aclocal.m4 b/source4/cluster/ctdb/aclocal.m4
deleted file mode 100644 (file)
index 5605e47..0000000
+++ /dev/null
@@ -1 +0,0 @@
-m4_include(libreplace.m4)
diff --git a/source4/cluster/ctdb/autogen.sh b/source4/cluster/ctdb/autogen.sh
deleted file mode 100755 (executable)
index 500cab8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-rm -rf autom4te.cache
-rm -f configure config.h.in
-
-IPATHS="-I libreplace -I lib/replace -I ../libreplace -I ../replace"
-IPATHS="$IPATHS -I lib/talloc -I talloc -I ../talloc"
-IPATHS="$IPATHS -I lib/tdb -I tdb -I ../tdb"
-IPATHS="$IPATHS -I lib/popt -I popt -I ../popt"
-autoheader $IPATHS || exit 1
-autoconf $IPATHS || exit 1
-
-rm -rf autom4te.cache
-
-echo "Now run ./configure and then make."
-exit 0
-
diff --git a/source4/cluster/ctdb/brlock_ctdb.c b/source4/cluster/ctdb/brlock_ctdb.c
deleted file mode 100644 (file)
index 1cc6beb..0000000
+++ /dev/null
@@ -1,945 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-
-   generic byte range locking code - ctdb backend
-
-   Copyright (C) Andrew Tridgell 2006
-   
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "system/filesys.h"
-#include "../tdb/include/tdb.h"
-#include "messaging/messaging.h"
-#include "lib/messaging/irpc.h"
-#include "libcli/libcli.h"
-#include "cluster/cluster.h"
-#include "ntvfs/ntvfs.h"
-#include "ntvfs/common/brlock.h"
-#include "include/ctdb.h"
-
-enum my_functions {FUNC_BRL_LOCK=1, FUNC_BRL_UNLOCK=2, 
-                  FUNC_BRL_REMOVE_PENDING=3, FUNC_BRL_LOCKTEST=4,
-                  FUNC_BRL_CLOSE=5};
-
-/*
-  in this module a "DATA_BLOB *file_key" is a blob that uniquely identifies
-  a file. For a local posix filesystem this will usually be a combination
-  of the device and inode numbers of the file, but it can be anything 
-  that uniquely idetifies a file for locking purposes, as long
-  as it is applied consistently.
-*/
-
-/* this struct is typically attached to tcon */
-struct brl_context {
-       struct ctdb_context *ctdb;
-       struct ctdb_db_context *ctdb_db;
-       struct server_id server;
-       struct messaging_context *messaging_ctx;
-};
-
-/*
-  the lock context contains the elements that define whether one
-  lock is the same as another lock
-*/
-struct lock_context {
-       struct server_id server;
-       uint16_t smbpid;
-       struct brl_context *ctx;
-};
-
-/* The data in brlock records is an unsorted linear array of these
-   records.  It is unnecessary to store the count as tdb provides the
-   size of the record */
-struct lock_struct {
-       struct lock_context context;
-       struct ntvfs_handle *ntvfs;
-       uint64_t start;
-       uint64_t size;
-       enum brl_type lock_type;
-       void *notify_ptr;
-};
-
-/* this struct is attached to on open file handle */
-struct brl_handle {
-       DATA_BLOB key;
-       struct ntvfs_handle *ntvfs;
-       struct lock_struct last_lock;
-};
-
-#if 0
-static void show_locks(const char *op, struct lock_struct *locks, int count)
-{
-       int i;
-       DEBUG(0,("OP: %s\n", op));
-       if (locks == NULL) return;
-       for (i=0;i<count;i++) {
-               DEBUG(0,("%2d: %4d %4d %d.%d.%d %p %p\n",
-                        i, (int)locks[i].start, (int)locks[i].size, 
-                        locks[i].context.server.node,
-                        locks[i].context.server.id,
-                        locks[i].context.smbpid,
-                        locks[i].context.ctx,
-                        locks[i].ntvfs));
-       }
-}
-#endif
-
-/*
-  Open up the brlock.tdb database. Close it down using
-  talloc_free(). We need the messaging_ctx to allow for
-  pending lock notifications.
-*/
-static struct brl_context *brl_ctdb_init(TALLOC_CTX *mem_ctx, struct server_id server, struct loadparm_context *lp_ctx,
-                                   struct messaging_context *messaging_ctx)
-{
-       struct ctdb_context *ctdb = talloc_get_type(cluster_backend_handle(), 
-                                                   struct ctdb_context);
-       struct brl_context *brl;
-
-       brl = talloc(mem_ctx, struct brl_context);
-       if (brl == NULL) {
-               return NULL;
-       }
-
-       brl->ctdb = ctdb;
-       brl->ctdb_db = ctdb_db_handle(ctdb, "brlock");
-       if (brl->ctdb_db == NULL) {
-               DEBUG(0,("Failed to get attached ctdb db handle for brlock\n"));
-               talloc_free(brl);
-               return NULL;
-       }
-       brl->server = server;
-       brl->messaging_ctx = messaging_ctx;
-
-       return brl;
-}
-
-static struct brl_handle *brl_ctdb_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, 
-                                                   DATA_BLOB *file_key)
-{
-       struct brl_handle *brlh;
-
-       brlh = talloc(mem_ctx, struct brl_handle);
-       if (brlh == NULL) {
-               return NULL;
-       }
-
-       brlh->key = *file_key;
-       brlh->ntvfs = ntvfs;
-       ZERO_STRUCT(brlh->last_lock);
-
-       return brlh;
-}
-
-/*
-  see if two locking contexts are equal
-*/
-static bool brl_ctdb_same_context(struct lock_context *ctx1, struct lock_context *ctx2)
-{
-       return (cluster_id_equal(&ctx1->server, &ctx2->server) &&
-               ctx1->smbpid == ctx2->smbpid &&
-               ctx1->ctx == ctx2->ctx);
-}
-
-/*
-  see if lck1 and lck2 overlap
-*/
-static bool brl_ctdb_overlap(struct lock_struct *lck1, 
-                       struct lock_struct *lck2)
-{
-       /* this extra check is not redundent - it copes with locks
-          that go beyond the end of 64 bit file space */
-       if (lck1->size != 0 &&
-           lck1->start == lck2->start &&
-           lck1->size == lck2->size) {
-               return true;
-       }
-           
-       if (lck1->start >= (lck2->start+lck2->size) ||
-           lck2->start >= (lck1->start+lck1->size)) {
-               return false;
-       }
-       return true;
-} 
-
-/*
- See if lock2 can be added when lock1 is in place.
-*/
-static bool brl_ctdb_conflict(struct lock_struct *lck1, 
-                        struct lock_struct *lck2)
-{
-       /* pending locks don't conflict with anything */
-       if (lck1->lock_type >= PENDING_READ_LOCK ||
-           lck2->lock_type >= PENDING_READ_LOCK) {
-               return false;
-       }
-
-       if (lck1->lock_type == READ_LOCK && lck2->lock_type == READ_LOCK) {
-               return false;
-       }
-
-       if (brl_ctdb_same_context(&lck1->context, &lck2->context) &&
-           lck2->lock_type == READ_LOCK && lck1->ntvfs == lck2->ntvfs) {
-               return false;
-       }
-
-       return brl_ctdb_overlap(lck1, lck2);
-} 
-
-
-/*
- Check to see if this lock conflicts, but ignore our own locks on the
- same fnum only.
-*/
-static bool brl_ctdb_conflict_other(struct lock_struct *lck1, struct lock_struct *lck2)
-{
-       /* pending locks don't conflict with anything */
-       if (lck1->lock_type >= PENDING_READ_LOCK ||
-           lck2->lock_type >= PENDING_READ_LOCK) {
-               return false;
-       }
-
-       if (lck1->lock_type == READ_LOCK && lck2->lock_type == READ_LOCK) 
-               return false;
-
-       /*
-        * note that incoming write calls conflict with existing READ
-        * locks even if the context is the same. JRA. See LOCKTEST7
-        * in smbtorture.
-        */
-       if (brl_ctdb_same_context(&lck1->context, &lck2->context) &&
-           lck1->ntvfs == lck2->ntvfs &&
-           (lck2->lock_type == READ_LOCK || lck1->lock_type == WRITE_LOCK)) {
-               return false;
-       }
-
-       return brl_ctdb_overlap(lck1, lck2);
-} 
-
-
-/*
-  amazingly enough, w2k3 "remembers" whether the last lock failure
-  is the same as this one and changes its error code. I wonder if any
-  app depends on this?
-*/
-static NTSTATUS brl_ctdb_lock_failed(struct brl_handle *brlh, struct lock_struct *lock)
-{
-       /*
-        * this function is only called for non pending lock!
-        */
-
-       /* in SMB2 mode always return NT_STATUS_LOCK_NOT_GRANTED! */
-       if (lock->ntvfs->ctx->protocol == PROTOCOL_SMB2) {
-               return NT_STATUS_LOCK_NOT_GRANTED;
-       }
-
-       /* 
-        * if the notify_ptr is non NULL,
-        * it means that we're at the end of a pending lock
-        * and the real lock is requested after the timeout went by
-        * In this case we need to remember the last_lock and always
-        * give FILE_LOCK_CONFLICT
-        */
-       if (lock->notify_ptr) {
-               brlh->last_lock = *lock;
-               return NT_STATUS_FILE_LOCK_CONFLICT;
-       }
-
-       /* 
-        * amazing the little things you learn with a test
-        * suite. Locks beyond this offset (as a 64 bit
-        * number!) always generate the conflict error code,
-        * unless the top bit is set
-        */
-       if (lock->start >= 0xEF000000 && (lock->start >> 63) == 0) {
-               brlh->last_lock = *lock;
-               return NT_STATUS_FILE_LOCK_CONFLICT;
-       }
-
-       /*
-        * if the current lock matches the last failed lock on the file handle
-        * and starts at the same offset, then FILE_LOCK_CONFLICT should be returned
-        */
-       if (cluster_id_equal(&lock->context.server, &brlh->last_lock.context.server) &&
-           lock->context.ctx == brlh->last_lock.context.ctx &&
-           lock->ntvfs == brlh->last_lock.ntvfs &&
-           lock->start == brlh->last_lock.start) {
-               return NT_STATUS_FILE_LOCK_CONFLICT;
-       }
-
-       brlh->last_lock = *lock;
-       return NT_STATUS_LOCK_NOT_GRANTED;
-}
-
-struct ctdb_lock_req {
-       uint16_t smbpid;
-       uint64_t start;
-       uint64_t size;
-       enum brl_type lock_type;
-       void *notify_ptr;
-       struct server_id server;
-       struct brl_context *brl;
-       struct ntvfs_handle *ntvfs;
-};
-
-/*
-  ctdb call handling brl_lock()
-*/
-static int brl_ctdb_lock_func(struct ctdb_call_info *call)
-{
-       struct ctdb_lock_req *req = (struct ctdb_lock_req *)call->call_data->dptr;
-       TDB_DATA dbuf;
-       int count=0, i;
-       struct lock_struct lock, *locks=NULL;
-       NTSTATUS status = NT_STATUS_OK;
-
-       /* if this is a pending lock, then with the chainlock held we
-          try to get the real lock. If we succeed then we don't need
-          to make it pending. This prevents a possible race condition
-          where the pending lock gets created after the lock that is
-          preventing the real lock gets removed */
-       if (req->lock_type >= PENDING_READ_LOCK) {
-               enum brl_type lock_type = req->lock_type;
-               req->lock_type = (req->lock_type==PENDING_READ_LOCK? READ_LOCK : WRITE_LOCK);
-               if (brl_ctdb_lock_func(call) == 0 && call->status == NT_STATUS_V(NT_STATUS_OK)) {
-                       return 0;
-               }
-               req->lock_type = lock_type;
-       }
-
-       dbuf = call->record_data;
-
-       ZERO_STRUCT(lock);
-       lock.context.smbpid = req->smbpid;
-       lock.context.server = req->server;
-       lock.context.ctx = req->brl;
-       lock.ntvfs = req->ntvfs;
-       lock.start = req->start;
-       lock.size = req->size;
-       lock.lock_type = req->lock_type;
-       lock.notify_ptr = req->notify_ptr;
-
-       if (dbuf.dptr) {
-               /* there are existing locks - make sure they don't conflict */
-               locks = (struct lock_struct *)dbuf.dptr;
-               count = dbuf.dsize / sizeof(*locks);
-
-               for (i=0; i<count; i++) {
-                       if (brl_ctdb_conflict(&locks[i], &lock)) {
-                               status = NT_STATUS_LOCK_NOT_GRANTED;
-                               goto reply;
-                       }
-               }
-       }
-
-       call->new_data = talloc(call, TDB_DATA);
-       if (call->new_data == NULL) {
-               return CTDB_ERR_NOMEM;
-       }
-
-       call->new_data->dptr = talloc_size(call, dbuf.dsize + sizeof(lock));
-       if (call->new_data->dptr == NULL) {
-               return CTDB_ERR_NOMEM;
-       }
-       memcpy(call->new_data->dptr, locks, dbuf.dsize);
-       memcpy(call->new_data->dptr+dbuf.dsize, &lock, sizeof(lock));
-       call->new_data->dsize = dbuf.dsize + sizeof(lock);
-
-       if (req->lock_type >= PENDING_READ_LOCK) {
-               status = NT_STATUS_LOCK_NOT_GRANTED;
-       }
-
-reply:
-       call->status = NT_STATUS_V(status);
-
-       return 0;
-}
-
-
-/*
-  Lock a range of bytes.  The lock_type can be a PENDING_*_LOCK, in
-  which case a real lock is first tried, and if that fails then a
-  pending lock is created. When the pending lock is triggered (by
-  someone else closing an overlapping lock range) a messaging
-  notification is sent, identified by the notify_ptr
-*/
-static NTSTATUS brl_ctdb_lock(struct brl_context *brl,
-                             struct brl_handle *brlh,
-                             uint32_t smbpid,
-                             uint64_t start, uint64_t size, 
-                             enum brl_type lock_type,
-                             void *notify_ptr)
-{
-       struct ctdb_lock_req req;
-       struct ctdb_call call;
-       int ret;
-       NTSTATUS status;
-
-       call.call_id = FUNC_BRL_LOCK;
-       call.key.dptr = brlh->key.data;
-       call.key.dsize = brlh->key.length;
-       call.call_data.dptr = (uint8_t *)&req;
-       call.call_data.dsize = sizeof(req);
-       call.flags = 0;
-       call.status = 0;
-
-       ZERO_STRUCT(req);
-       req.smbpid = smbpid;
-       req.start  = start;
-       req.size   = size;
-       req.lock_type = lock_type;
-       req.notify_ptr = notify_ptr;
-       req.server = brl->server;
-       req.brl = brl;
-       req.ntvfs = brlh->ntvfs;
-
-       ret = ctdb_call(brl->ctdb_db, &call);
-       if (ret == -1) {
-               return NT_STATUS_INTERNAL_DB_CORRUPTION;
-       }
-
-       status = NT_STATUS(call.status);
-
-       if (NT_STATUS_EQUAL(status, NT_STATUS_LOCK_NOT_GRANTED)) {
-               struct lock_struct lock;
-               lock.context.smbpid = smbpid;
-               lock.context.server = brl->server;
-               lock.context.ctx = brl;
-               lock.ntvfs = brlh->ntvfs;
-               lock.start = start;
-               lock.size = size;
-               lock.lock_type = lock_type;
-               lock.notify_ptr = notify_ptr;
-               status = brl_ctdb_lock_failed(brlh, &lock);
-       }
-
-       return status;
-}
-
-/*
-  we are removing a lock that might be holding up a pending lock. Scan
-  for pending locks that cover this range and if we find any then
-  notify the server that it should retry the lock. In this backend, we
-  notify by sending the list of locks that need to be notified on back
-  in the reply_data of the ctdb call. The caller then does the
-  messaging for us. 
-*/
-static int brl_ctdb_notify_unlock(struct ctdb_call_info *call,
-                                 struct lock_struct *locks, int count, 
-                                  struct lock_struct *removed_lock)
-{
-       int i, last_notice;
-
-       /* the last_notice logic is to prevent stampeding on a lock
-          range. It prevents us sending hundreds of notifies on the
-          same range of bytes. It doesn't prevent all possible
-          stampedes, but it does prevent the most common problem */
-       last_notice = -1;
-
-       for (i=0;i<count;i++) {
-               if (locks[i].lock_type >= PENDING_READ_LOCK &&
-                   brl_ctdb_overlap(&locks[i], removed_lock)) {
-                       struct lock_struct *nlocks;
-                       int ncount;
-
-                       if (last_notice != -1 && brl_ctdb_overlap(&locks[i], &locks[last_notice])) {
-                               continue;
-                       }
-                       if (locks[i].lock_type == PENDING_WRITE_LOCK) {
-                               last_notice = i;
-                       }
-                       if (call->reply_data == NULL) {
-                               call->reply_data = talloc_zero(call, TDB_DATA);
-                               if (call->reply_data == NULL) {
-                                       return CTDB_ERR_NOMEM;
-                               }
-                       }
-                       /* add to the list of pending locks to notify caller of */
-                       ncount = call->reply_data->dsize / sizeof(struct lock_struct);
-                       nlocks = talloc_realloc(call->reply_data, call->reply_data->dptr, 
-                                               struct lock_struct, ncount + 1);
-                       if (nlocks == NULL) {
-                               return CTDB_ERR_NOMEM;
-                       }
-                       call->reply_data->dptr = (uint8_t *)nlocks;
-                       nlocks[ncount] = locks[i];
-                       call->reply_data->dsize += sizeof(struct lock_struct);
-               }
-       }
-
-       return 0;
-}
-
-/*
-  send notifications for all pending locks - the file is being closed by this
-  user
-*/
-static int brl_ctdb_notify_all(struct ctdb_call_info *call,
-                               struct lock_struct *locks, int count)
-{
-       int i;
-       for (i=0;i<count;i++) {
-               if (locks->lock_type >= PENDING_READ_LOCK) {
-                       int ret = brl_ctdb_notify_unlock(call, locks, count, &locks[i]);
-                       if (ret != 0) return ret;
-               }
-       }
-       return 0;
-}
-
-/*
-  send off any messages needed to notify of pending locks that should now retry
-*/
-static void brl_ctdb_notify_send(struct brl_context *brl, TDB_DATA *reply_data)
-{
-       struct lock_struct *locks = (struct lock_struct *)reply_data->dptr;
-       int i, count = reply_data->dsize / sizeof(struct lock_struct);
-       for (i=0;i<count;i++) {
-               messaging_send_ptr(brl->messaging_ctx, locks[i].context.server, 
-                                  MSG_BRL_RETRY, locks[i].notify_ptr);
-       }
-}
-
-
-struct ctdb_unlock_req {
-       uint16_t smbpid;
-       uint64_t start;
-       uint64_t size;
-       struct server_id server;
-       struct brl_context *brl;
-       struct ntvfs_handle *ntvfs;
-};
-
-/*
- Unlock a range of bytes.
-*/
-static int brl_ctdb_unlock_func(struct ctdb_call_info *call)
-{
-       struct ctdb_unlock_req *req = (struct ctdb_unlock_req *)call->call_data->dptr;
-       TDB_DATA dbuf;
-       int count, i;
-       struct lock_struct *locks, *lock;
-       struct lock_context context;
-       NTSTATUS status = NT_STATUS_OK;
-
-       dbuf = call->record_data;
-
-       context.smbpid = req->smbpid;
-       context.server = req->server;
-       context.ctx = req->brl;
-
-       /* there are existing locks - find a match */
-       locks = (struct lock_struct *)dbuf.dptr;
-       count = dbuf.dsize / sizeof(*locks);
-
-       for (i=0; i<count; i++) {
-               lock = &locks[i];
-               if (brl_ctdb_same_context(&lock->context, &context) &&
-                   lock->ntvfs == req->ntvfs &&
-                   lock->start == req->start &&
-                   lock->size == req->size &&
-                   lock->lock_type == WRITE_LOCK) {
-                       break;
-               }
-       }
-       if (i < count) goto found;
-
-       for (i=0; i<count; i++) {
-               lock = &locks[i];
-               if (brl_ctdb_same_context(&lock->context, &context) &&
-                   lock->ntvfs == req->ntvfs &&
-                   lock->start == req->start &&
-                   lock->size == req->size &&
-                   lock->lock_type < PENDING_READ_LOCK) {
-                       break;
-               }
-       }
-
-found:
-       if (i < count) {
-               struct lock_struct removed_lock = *lock;
-
-               call->new_data = talloc(call, TDB_DATA);
-               if (call->new_data == NULL) {
-                       return CTDB_ERR_NOMEM;
-               }
-               
-               call->new_data->dptr = talloc_size(call, dbuf.dsize - sizeof(*lock));
-               if (call->new_data->dptr == NULL) {
-                       return CTDB_ERR_NOMEM;
-               }
-               call->new_data->dsize = dbuf.dsize - sizeof(*lock);
-               
-               memcpy(call->new_data->dptr, locks, i*sizeof(*lock));
-               memcpy(call->new_data->dptr+i*sizeof(*lock), locks+i+1,
-                      (count-(i+1))*sizeof(*lock));
-               
-               if (count > 1) {
-                       int ret = brl_ctdb_notify_unlock(call, locks, count, &removed_lock);
-                       if (ret != 0) return ret;
-               }
-       }
-
-       if (i == count) {
-               /* we didn't find it */
-               status = NT_STATUS_RANGE_NOT_LOCKED;
-       }
-
-       call->status = NT_STATUS_V(status);
-
-       return 0;
-}
-
-
-/*
- Unlock a range of bytes.
-*/
-static NTSTATUS brl_ctdb_unlock(struct brl_context *brl,
-                               struct brl_handle *brlh, 
-                               uint32_t smbpid,
-                               uint64_t start, uint64_t size)
-{
-       struct ctdb_call call;
-       struct ctdb_unlock_req req;
-       int ret;
-
-       call.call_id = FUNC_BRL_UNLOCK;
-       call.key.dptr = brlh->key.data;
-       call.key.dsize = brlh->key.length;
-       call.call_data.dptr = (uint8_t *)&req;
-       call.call_data.dsize = sizeof(req);
-
-       ZERO_STRUCT(req);
-       req.smbpid = smbpid;
-       req.start  = start;
-       req.size   = size;
-       req.server = brl->server;
-       req.brl = brl;
-       req.ntvfs = brlh->ntvfs;
-               
-       ret = ctdb_call(brl->ctdb_db, &call);
-       if (ret == -1) {
-               DEBUG(0,("ctdb_call failed - %s\n", __location__));
-               return NT_STATUS_INTERNAL_DB_CORRUPTION;
-       }
-
-       brl_ctdb_notify_send(brl, &call.reply_data);
-
-       return NT_STATUS(call.status);
-}
-
-
-struct ctdb_remove_pending_req {
-       struct server_id server;
-       void *notify_ptr;
-};
-
-/*
-  remove a pending lock. This is called when the caller has either
-  given up trying to establish a lock or when they have succeeded in
-  getting it. In either case they no longer need to be notified.
-*/
-static int brl_ctdb_remove_pending_func(struct ctdb_call_info *call)
-{
-       struct ctdb_remove_pending_req *req = (struct ctdb_remove_pending_req *)call->call_data->dptr;
-       TDB_DATA dbuf;
-       int count, i;
-       struct lock_struct *locks;
-       NTSTATUS status = NT_STATUS_OK;
-
-       dbuf = call->record_data;
-
-       /* there are existing locks - find a match */
-       locks = (struct lock_struct *)dbuf.dptr;
-       count = dbuf.dsize / sizeof(*locks);
-
-       for (i=0; i<count; i++) {
-               struct lock_struct *lock = &locks[i];
-               
-               if (lock->lock_type >= PENDING_READ_LOCK &&
-                   lock->notify_ptr == req->notify_ptr &&
-                   cluster_id_equal(&lock->context.server, &req->server)) {
-                       call->new_data = talloc(call, TDB_DATA);
-                       if (call->new_data == NULL) {
-                               return CTDB_ERR_NOMEM;
-                       }
-
-                       call->new_data->dptr = talloc_size(call, dbuf.dsize - sizeof(*lock));
-                       if (call->new_data->dptr == NULL) {
-                               return CTDB_ERR_NOMEM;
-                       }
-                       call->new_data->dsize = dbuf.dsize - sizeof(*lock);
-
-                       memcpy(call->new_data->dptr, locks, i*sizeof(*lock));
-                       memcpy(call->new_data->dptr+i*sizeof(*lock), locks+i+1,
-                              (count-(i+1))*sizeof(*lock));
-                       break;
-               }
-       }
-       
-       if (i == count) {
-               /* we didn't find it */
-               status = NT_STATUS_RANGE_NOT_LOCKED;
-       }
-
-       call->status = NT_STATUS_V(status);
-
-       return 0;
-}
-
-static NTSTATUS brl_ctdb_remove_pending(struct brl_context *brl,
-                                       struct brl_handle *brlh, 
-                                       void *notify_ptr)
-{
-       struct ctdb_call call;
-       struct ctdb_remove_pending_req req;
-       int ret;
-
-       call.call_id = FUNC_BRL_REMOVE_PENDING;
-       call.key.dptr = brlh->key.data;
-       call.key.dsize = brlh->key.length;
-       call.call_data.dptr = (uint8_t *)&req;
-       call.call_data.dsize = sizeof(req);
-
-       ZERO_STRUCT(req);
-       req.notify_ptr = notify_ptr;
-       req.server = brl->server;
-               
-       ret = ctdb_call(brl->ctdb_db, &call);
-       if (ret == -1) {
-               DEBUG(0,("ctdb_call failed - %s\n", __location__));
-               return NT_STATUS_INTERNAL_DB_CORRUPTION;
-       }
-
-       return NT_STATUS(call.status);
-}
-
-
-struct ctdb_locktest_req {
-       uint16_t smbpid;
-       uint64_t start;
-       uint64_t size;
-       enum brl_type lock_type;
-       struct brl_context *brl;
-       struct server_id server;
-       struct ntvfs_handle *ntvfs;
-};
-
-/*
-  remove a pending lock. This is called when the caller has either
-  given up trying to establish a lock or when they have succeeded in
-  getting it. In either case they no longer need to be notified.
-*/
-static int brl_ctdb_locktest_func(struct ctdb_call_info *call)
-{
-       struct ctdb_locktest_req *req = (struct ctdb_locktest_req *)call->call_data->dptr;
-       TDB_DATA dbuf;
-       int count, i;
-       struct lock_struct *locks, lock;
-       NTSTATUS status = NT_STATUS_OK;
-
-       lock.context.smbpid = req->smbpid;
-       lock.context.server = req->server;
-       lock.context.ctx = req->brl;
-       lock.ntvfs = req->ntvfs;
-       lock.start = req->start;
-       lock.size = req->size;
-       lock.lock_type = req->lock_type;
-
-       dbuf = call->record_data;
-
-       /* there are existing locks - find a match */
-       locks = (struct lock_struct *)dbuf.dptr;
-       count = dbuf.dsize / sizeof(*locks);
-
-       for (i=0; i<count; i++) {
-               if (brl_ctdb_conflict_other(&locks[i], &lock)) {
-                       status = NT_STATUS_FILE_LOCK_CONFLICT;
-                       break;
-               }
-       }
-       
-       call->status = NT_STATUS_V(status);
-
-       return 0;
-}
-
-/*
-  Test if we are allowed to perform IO on a region of an open file
-*/
-static NTSTATUS brl_ctdb_locktest(struct brl_context *brl,
-                                 struct brl_handle *brlh,
-                                 uint32_t smbpid, 
-                                 uint64_t start, uint64_t size, 
-                                 enum brl_type lock_type)
-{
-       struct ctdb_call call;
-       struct ctdb_locktest_req req;
-       int ret;
-
-       call.call_id = FUNC_BRL_LOCKTEST;
-       call.key.dptr = brlh->key.data;
-       call.key.dsize = brlh->key.length;
-       call.call_data.dptr = (uint8_t *)&req;
-       call.call_data.dsize = sizeof(req);
-
-       ZERO_STRUCT(req);
-       req.smbpid = smbpid;
-       req.start  = start;
-       req.size   = size;
-       req.lock_type = lock_type;
-       req.server = brl->server;
-       req.brl = brl;
-       req.ntvfs = brlh->ntvfs;
-
-       ret = ctdb_call(brl->ctdb_db, &call);
-       if (ret == -1) {
-               DEBUG(0,("ctdb_call failed - %s\n", __location__));
-               return NT_STATUS_INTERNAL_DB_CORRUPTION;
-       }
-
-       return NT_STATUS(call.status);
-}
-
-
-struct ctdb_close_req {
-       struct brl_context *brl;
-       struct server_id server;
-       struct ntvfs_handle *ntvfs;
-};
-
-/*
-  remove a pending lock. This is called when the caller has either
-  given up trying to establish a lock or when they have succeeded in
-  getting it. In either case they no longer need to be notified.
-*/
-static int brl_ctdb_close_func(struct ctdb_call_info *call)
-{
-       struct ctdb_close_req *req = (struct ctdb_close_req *)call->call_data->dptr;
-       TDB_DATA dbuf;
-       int count, dcount=0, i;
-       struct lock_struct *locks;
-       NTSTATUS status = NT_STATUS_OK;
-
-       dbuf = call->record_data;
-
-       /* there are existing locks - find a match */
-       locks = (struct lock_struct *)dbuf.dptr;
-       count = dbuf.dsize / sizeof(*locks);
-
-       for (i=0; i<count; i++) {
-               struct lock_struct *lock = &locks[i];
-
-               if (lock->context.ctx == req->brl &&
-                   cluster_id_equal(&lock->context.server, &req->server) &&
-                   lock->ntvfs == req->ntvfs) {
-                       /* found it - delete it */
-                       if (count > 1 && i < count-1) {
-                               memmove(&locks[i], &locks[i+1], 
-                                       sizeof(*locks)*((count-1) - i));
-                       }
-                       count--;
-                       i--;
-                       dcount++;
-               }
-       }
-
-       if (dcount > 0) {
-               call->new_data = talloc(call, TDB_DATA);
-               if (call->new_data == NULL) {
-                       return CTDB_ERR_NOMEM;
-               }
-
-               brl_ctdb_notify_all(call, locks, count);
-               
-               call->new_data->dptr = talloc_size(call, count*sizeof(struct lock_struct));
-               if (call->new_data->dptr == NULL) {
-                       return CTDB_ERR_NOMEM;
-               }
-               call->new_data->dsize = count*sizeof(struct lock_struct);
-
-               memcpy(call->new_data->dptr, locks, count*sizeof(struct lock_struct));
-       }
-
-       call->status = NT_STATUS_V(status);
-
-       return 0;
-}
-
-/*
-  Test if we are allowed to perform IO on a region of an open file
-*/
-static NTSTATUS brl_ctdb_close(struct brl_context *brl,
-                              struct brl_handle *brlh)
-{
-       struct ctdb_call call;
-       struct ctdb_close_req req;
-       int ret;
-
-       call.call_id = FUNC_BRL_CLOSE;
-       call.key.dptr = brlh->key.data;
-       call.key.dsize = brlh->key.length;
-       call.call_data.dptr = (uint8_t *)&req;
-       call.call_data.dsize = sizeof(req);
-
-       ZERO_STRUCT(req);
-       req.brl = brl;
-       req.server = brl->server;
-       req.ntvfs = brlh->ntvfs;
-
-       ret = ctdb_call(brl->ctdb_db, &call);
-       if (ret == -1) {
-               DEBUG(0,("ctdb_call failed - %s\n", __location__));
-               return NT_STATUS_INTERNAL_DB_CORRUPTION;
-       }
-
-       brl_ctdb_notify_send(brl, &call.reply_data);
-
-       return NT_STATUS(call.status);
-}
-
-
-static const struct brlock_ops brlock_tdb_ops = {
-       .brl_init           = brl_ctdb_init,
-       .brl_create_handle  = brl_ctdb_create_handle,
-       .brl_lock           = brl_ctdb_lock,
-       .brl_unlock         = brl_ctdb_unlock,
-       .brl_remove_pending = brl_ctdb_remove_pending,
-       .brl_locktest       = brl_ctdb_locktest,
-       .brl_close          = brl_ctdb_close
-};
-
-
-void brl_ctdb_init_ops(void)
-{
-       struct ctdb_context *ctdb = talloc_get_type(cluster_backend_handle(), 
-                                                   struct ctdb_context);
-       struct ctdb_db_context *ctdb_db;
-
-       brl_set_ops(&brlock_tdb_ops);
-
-       ctdb_db = ctdb_db_handle(ctdb, "brlock");
-       if (ctdb_db == NULL) {
-               DEBUG(0,("Failed to get attached ctdb db handle for brlock\n"));
-               return;
-       }
-
-       ctdb_set_call(ctdb_db, brl_ctdb_lock_func,  FUNC_BRL_LOCK);
-       ctdb_set_call(ctdb_db, brl_ctdb_unlock_func,  FUNC_BRL_UNLOCK);
-       ctdb_set_call(ctdb_db, brl_ctdb_remove_pending_func,  FUNC_BRL_REMOVE_PENDING);
-       ctdb_set_call(ctdb_db, brl_ctdb_locktest_func,  FUNC_BRL_LOCKTEST);
-       ctdb_set_call(ctdb_db, brl_ctdb_close_func,  FUNC_BRL_CLOSE);
-}
diff --git a/source4/cluster/ctdb/client/ctdb_client.c b/source4/cluster/ctdb/client/ctdb_client.c
deleted file mode 100644 (file)
index a83dd7a..0000000
+++ /dev/null
@@ -1,2225 +0,0 @@
-/* 
-   ctdb daemon code
-
-   Copyright (C) Andrew Tridgell  2007
-   Copyright (C) Ronnie Sahlberg  2007
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "tdb_wrap.h"
-#include "../tdb/include/tdb.h"
-#include "../lib/util/dlinklist.h"
-#include "lib/events/events.h"
-#include "system/network.h"
-#include "system/filesys.h"
-#include "../include/ctdb_private.h"
-#include "../lib/util/dlinklist.h"
-
-/*
-  allocate a packet for use in client<->daemon communication
- */
-struct ctdb_req_header *_ctdbd_allocate_pkt(struct ctdb_context *ctdb,
-                                           TALLOC_CTX *mem_ctx, 
-                                           enum ctdb_operation operation, 
-                                           size_t length, size_t slength,
-                                           const char *type)
-{
-       int size;
-       struct ctdb_req_header *hdr;
-
-       length = MAX(length, slength);
-       size = (length+(CTDB_DS_ALIGNMENT-1)) & ~(CTDB_DS_ALIGNMENT-1);
-
-       hdr = (struct ctdb_req_header *)talloc_size(mem_ctx, size);
-       if (hdr == NULL) {
-               DEBUG(0,("Unable to allocate packet for operation %u of length %u\n",
-                        operation, (unsigned)length));
-               return NULL;
-       }
-       talloc_set_name_const(hdr, type);
-       memset(hdr, 0, slength);
-       hdr->length       = length;
-       hdr->operation    = operation;
-       hdr->ctdb_magic   = CTDB_MAGIC;
-       hdr->ctdb_version = CTDB_VERSION;
-       hdr->srcnode      = ctdb->vnn;
-       if (ctdb->vnn_map) {
-               hdr->generation = ctdb->vnn_map->generation;
-       }
-
-       return hdr;
-}
-
-/*
-  local version of ctdb_call
-*/
-int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call,
-                   struct ctdb_ltdb_header *header, TALLOC_CTX *mem_ctx,
-                   TDB_DATA *data, uint32_t caller)
-{
-       struct ctdb_call_info *c;
-       struct ctdb_registered_call *fn;
-       struct ctdb_context *ctdb = ctdb_db->ctdb;
-       
-       c = talloc(ctdb, struct ctdb_call_info);
-       CTDB_NO_MEMORY(ctdb, c);
-
-       c->key = call->key;
-       c->call_data = &call->call_data;
-       c->record_data.dptr = (unsigned char *)talloc_memdup(c, data->dptr, data->dsize);
-       c->record_data.dsize = data->dsize;
-       CTDB_NO_MEMORY(ctdb, c->record_data.dptr);
-       c->new_data = NULL;
-       c->reply_data = NULL;
-       c->status = 0;
-
-       for (fn=ctdb_db->calls;fn;fn=fn->next) {
-               if (fn->id == call->call_id) break;
-       }
-       if (fn == NULL) {
-               ctdb_set_error(ctdb, "Unknown call id %u\n", call->call_id);
-               talloc_free(c);
-               return -1;
-       }
-
-       if (fn->fn(c) != 0) {
-               ctdb_set_error(ctdb, "ctdb_call %u failed\n", call->call_id);
-               talloc_free(c);
-               return -1;
-       }
-
-       if (header->laccessor != caller) {
-               header->lacount = 0;
-       }
-       header->laccessor = caller;
-       header->lacount++;
-
-       /* we need to force the record to be written out if this was a remote access,
-          so that the lacount is updated */
-       if (c->new_data == NULL && header->laccessor != ctdb->vnn) {
-               c->new_data = &c->record_data;
-       }
-
-       if (c->new_data) {
-               /* XXX check that we always have the lock here? */
-               if (ctdb_ltdb_store(ctdb_db, call->key, header, *c->new_data) != 0) {
-                       ctdb_set_error(ctdb, "ctdb_call tdb_store failed\n");
-                       talloc_free(c);
-                       return -1;
-               }
-       }
-
-       if (c->reply_data) {
-               call->reply_data = *c->reply_data;
-               talloc_steal(ctdb, call->reply_data.dptr);
-               talloc_set_name_const(call->reply_data.dptr, __location__);
-       } else {
-               call->reply_data.dptr = NULL;
-               call->reply_data.dsize = 0;
-       }
-       call->status = c->status;
-
-       talloc_free(c);
-
-       return 0;
-}
-
-
-/*
-  queue a packet for sending from client to daemon
-*/
-static int ctdb_client_queue_pkt(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
-{
-       return ctdb_queue_send(ctdb->daemon.queue, (uint8_t *)hdr, hdr->length);
-}
-
-
-/*
-  state of a in-progress ctdb call in client
-*/
-struct ctdb_client_call_state {
-       enum call_state state;
-       uint32_t reqid;
-       struct ctdb_db_context *ctdb_db;
-       struct ctdb_call call;
-};
-
-/*
-  called when a CTDB_REPLY_CALL packet comes in in the client
-
-  This packet comes in response to a CTDB_REQ_CALL request packet. It
-  contains any reply data from the call
-*/
-static void ctdb_client_reply_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
-{
-       struct ctdb_reply_call *c = (struct ctdb_reply_call *)hdr;
-       struct ctdb_client_call_state *state;
-
-       state = ctdb_reqid_find(ctdb, hdr->reqid, struct ctdb_client_call_state);
-       if (state == NULL) {
-               DEBUG(0,(__location__ " reqid %u not found\n", hdr->reqid));
-               return;
-       }
-
-       if (hdr->reqid != state->reqid) {
-               /* we found a record  but it was the wrong one */
-               DEBUG(0, ("Dropped client call reply with reqid:%u\n",hdr->reqid));
-               return;
-       }
-
-       state->call.reply_data.dptr = c->data;
-       state->call.reply_data.dsize = c->datalen;
-       state->call.status = c->status;
-
-       talloc_steal(state, c);
-
-       state->state = CTDB_CALL_DONE;
-}
-
-static void ctdb_client_reply_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr);
-
-/*
-  this is called in the client, when data comes in from the daemon
- */
-static void ctdb_client_read_cb(uint8_t *data, size_t cnt, void *args)
-{
-       struct ctdb_context *ctdb = talloc_get_type(args, struct ctdb_context);
-       struct ctdb_req_header *hdr = (struct ctdb_req_header *)data;
-       TALLOC_CTX *tmp_ctx;
-
-       /* place the packet as a child of a tmp_ctx. We then use
-          talloc_free() below to free it. If any of the calls want
-          to keep it, then they will steal it somewhere else, and the
-          talloc_free() will be a no-op */
-       tmp_ctx = talloc_new(ctdb);
-       talloc_steal(tmp_ctx, hdr);
-
-       if (cnt == 0) {
-               DEBUG(2,("Daemon has exited - shutting down client\n"));
-               exit(0);
-       }
-
-       if (cnt < sizeof(*hdr)) {
-               DEBUG(0,("Bad packet length %u in client\n", (unsigned)cnt));
-               goto done;
-       }
-       if (cnt != hdr->length) {
-               ctdb_set_error(ctdb, "Bad header length %u expected %u in client\n", 
-                              (unsigned)hdr->length, (unsigned)cnt);
-               goto done;
-       }
-
-       if (hdr->ctdb_magic != CTDB_MAGIC) {
-               ctdb_set_error(ctdb, "Non CTDB packet rejected in client\n");
-               goto done;
-       }
-
-       if (hdr->ctdb_version != CTDB_VERSION) {
-               ctdb_set_error(ctdb, "Bad CTDB version 0x%x rejected in client\n", hdr->ctdb_version);
-               goto done;
-       }
-
-       switch (hdr->operation) {
-       case CTDB_REPLY_CALL:
-               ctdb_client_reply_call(ctdb, hdr);
-               break;
-
-       case CTDB_REQ_MESSAGE:
-               ctdb_request_message(ctdb, hdr);
-               break;
-
-       case CTDB_REPLY_CONTROL:
-               ctdb_client_reply_control(ctdb, hdr);
-               break;
-
-       default:
-               DEBUG(0,("bogus operation code:%u\n",hdr->operation));
-       }
-
-done:
-       talloc_free(tmp_ctx);
-}
-
-/*
-  connect to a unix domain socket
-*/
-int ctdb_socket_connect(struct ctdb_context *ctdb)
-{
-       struct sockaddr_un addr;
-
-       memset(&addr, 0, sizeof(addr));
-       addr.sun_family = AF_UNIX;
-       strncpy(addr.sun_path, ctdb->daemon.name, sizeof(addr.sun_path));
-
-       ctdb->daemon.sd = socket(AF_UNIX, SOCK_STREAM, 0);
-       if (ctdb->daemon.sd == -1) {
-               return -1;
-       }
-
-       set_nonblocking(ctdb->daemon.sd);
-       set_close_on_exec(ctdb->daemon.sd);
-       
-       if (connect(ctdb->daemon.sd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
-               close(ctdb->daemon.sd);
-               ctdb->daemon.sd = -1;
-               return -1;
-       }
-
-       ctdb->daemon.queue = ctdb_queue_setup(ctdb, ctdb, ctdb->daemon.sd, 
-                                             CTDB_DS_ALIGNMENT, 
-                                             ctdb_client_read_cb, ctdb);
-       return 0;
-}
-
-
-struct ctdb_record_handle {
-       struct ctdb_db_context *ctdb_db;
-       TDB_DATA key;
-       TDB_DATA *data;
-       struct ctdb_ltdb_header header;
-};
-
-
-/*
-  make a recv call to the local ctdb daemon - called from client context
-
-  This is called when the program wants to wait for a ctdb_call to complete and get the 
-  results. This call will block unless the call has already completed.
-*/
-int ctdb_call_recv(struct ctdb_client_call_state *state, struct ctdb_call *call)
-{
-       while (state->state < CTDB_CALL_DONE) {
-               event_loop_once(state->ctdb_db->ctdb->ev);
-       }
-       if (state->state != CTDB_CALL_DONE) {
-               DEBUG(0,(__location__ " ctdb_call_recv failed\n"));
-               talloc_free(state);
-               return -1;
-       }
-
-       if (state->call.reply_data.dsize) {
-               call->reply_data.dptr = (unsigned char *)talloc_memdup(
-                                       state->ctdb_db,
-                                       state->call.reply_data.dptr,
-                                       state->call.reply_data.dsize);
-               call->reply_data.dsize = state->call.reply_data.dsize;
-       } else {
-               call->reply_data.dptr = NULL;
-               call->reply_data.dsize = 0;
-       }
-       call->status = state->call.status;
-       talloc_free(state);
-
-       return 0;
-}
-
-
-
-
-/*
-  destroy a ctdb_call in client
-*/
-static int ctdb_client_call_destructor(struct ctdb_client_call_state *state)   
-{
-       ctdb_reqid_remove(state->ctdb_db->ctdb, state->reqid);
-       return 0;
-}
-
-/*
-  construct an event driven local ctdb_call
-
-  this is used so that locally processed ctdb_call requests are processed
-  in an event driven manner
-*/
-static struct ctdb_client_call_state *ctdb_client_call_local_send(struct ctdb_db_context *ctdb_db, 
-                                                                 struct ctdb_call *call,
-                                                                 struct ctdb_ltdb_header *header,
-                                                                 TDB_DATA *data)
-{
-       struct ctdb_client_call_state *state;
-       struct ctdb_context *ctdb = ctdb_db->ctdb;
-       int ret;
-
-       state = talloc_zero(ctdb_db, struct ctdb_client_call_state);
-       CTDB_NO_MEMORY_NULL(ctdb, state);
-
-       talloc_steal(state, data->dptr);
-
-       state->state = CTDB_CALL_DONE;
-       state->call = *call;
-       state->ctdb_db = ctdb_db;
-
-       ret = ctdb_call_local(ctdb_db, &state->call, header, state, data, ctdb->vnn);
-
-       return state;
-}
-
-/*
-  make a ctdb call to the local daemon - async send. Called from client context.
-
-  This constructs a ctdb_call request and queues it for processing. 
-  This call never blocks.
-*/
-struct ctdb_client_call_state *ctdb_call_send(struct ctdb_db_context *ctdb_db, 
-                                      struct ctdb_call *call)
-{
-       struct ctdb_client_call_state *state;
-       struct ctdb_context *ctdb = ctdb_db->ctdb;
-       struct ctdb_ltdb_header header;
-       TDB_DATA data;
-       int ret;
-       size_t len;
-       struct ctdb_req_call *c;
-
-       /* if the domain socket is not yet open, open it */
-       if (ctdb->daemon.sd==-1) {
-               ctdb_socket_connect(ctdb);
-       }
-
-       ret = ctdb_ltdb_lock(ctdb_db, call->key);
-       if (ret != 0) {
-               DEBUG(0,(__location__ " Failed to get chainlock\n"));
-               return NULL;
-       }
-
-       ret = ctdb_ltdb_fetch(ctdb_db, call->key, &header, ctdb_db, &data);
-
-       if (ret == 0 && header.dmaster == ctdb->vnn) {
-               state = ctdb_client_call_local_send(ctdb_db, call, &header, &data);
-               talloc_free(data.dptr);
-               ctdb_ltdb_unlock(ctdb_db, call->key);
-               return state;
-       }
-
-       ctdb_ltdb_unlock(ctdb_db, call->key);
-       talloc_free(data.dptr);
-
-       state = talloc_zero(ctdb_db, struct ctdb_client_call_state);
-       if (state == NULL) {
-               DEBUG(0, (__location__ " failed to allocate state\n"));
-               return NULL;
-       }
-
-       len = offsetof(struct ctdb_req_call, data) + call->key.dsize + call->call_data.dsize;
-       c = ctdbd_allocate_pkt(ctdb, state, CTDB_REQ_CALL, len, struct ctdb_req_call);
-       if (c == NULL) {
-               DEBUG(0, (__location__ " failed to allocate packet\n"));
-               return NULL;
-       }
-
-       state->reqid     = ctdb_reqid_new(ctdb, state);
-       state->ctdb_db = ctdb_db;
-       talloc_set_destructor(state, ctdb_client_call_destructor);
-
-       c->hdr.reqid     = state->reqid;
-       c->flags         = call->flags;
-       c->db_id         = ctdb_db->db_id;
-       c->callid        = call->call_id;
-       c->hopcount      = 0;
-       c->keylen        = call->key.dsize;
-       c->calldatalen   = call->call_data.dsize;
-       memcpy(&c->data[0], call->key.dptr, call->key.dsize);
-       memcpy(&c->data[call->key.dsize], 
-              call->call_data.dptr, call->call_data.dsize);
-       state->call                = *call;
-       state->call.call_data.dptr = &c->data[call->key.dsize];
-       state->call.key.dptr       = &c->data[0];
-
-       state->state  = CTDB_CALL_WAIT;
-
-
-       ctdb_client_queue_pkt(ctdb, &c->hdr);
-
-       return state;
-}
-
-
-/*
-  full ctdb_call. Equivalent to a ctdb_call_send() followed by a ctdb_call_recv()
-*/
-int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call)
-{
-       struct ctdb_client_call_state *state;
-
-       state = ctdb_call_send(ctdb_db, call);
-       return ctdb_call_recv(state, call);
-}
-
-
-/*
-  tell the daemon what messaging srvid we will use, and register the message
-  handler function in the client
-*/
-int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid, 
-                            ctdb_message_fn_t handler,
-                            void *private_data)
-                                   
-{
-       int res;
-       int32_t status;
-       
-       res = ctdb_control(ctdb, CTDB_CURRENT_NODE, srvid, CTDB_CONTROL_REGISTER_SRVID, 0, 
-                          tdb_null, NULL, NULL, &status, NULL, NULL);
-       if (res != 0 || status != 0) {
-               DEBUG(0,("Failed to register srvid %llu\n", (unsigned long long)srvid));
-               return -1;
-       }
-
-       /* also need to register the handler with our own ctdb structure */
-       return ctdb_register_message_handler(ctdb, ctdb, srvid, handler, private_data);
-}
-
-/*
-  tell the daemon we no longer want a srvid
-*/
-static int ctdb_remove_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void *private_data)
-{
-       int res;
-       int32_t status;
-       
-       res = ctdb_control(ctdb, CTDB_CURRENT_NODE, srvid, CTDB_CONTROL_DEREGISTER_SRVID, 0, 
-                          tdb_null, NULL, NULL, &status, NULL, NULL);
-       if (res != 0 || status != 0) {
-               DEBUG(0,("Failed to deregister srvid %llu\n", (unsigned long long)srvid));
-               return -1;
-       }
-
-       /* also need to register the handler with our own ctdb structure */
-       ctdb_deregister_message_handler(ctdb, srvid, private_data);
-       return 0;
-}
-
-
-/*
-  send a message - from client context
- */
-int ctdb_send_message(struct ctdb_context *ctdb, uint32_t vnn,
-                     uint64_t srvid, TDB_DATA data)
-{
-       struct ctdb_req_message *r;
-       int len, res;
-
-       len = offsetof(struct ctdb_req_message, data) + data.dsize;
-       r = ctdbd_allocate_pkt(ctdb, ctdb, CTDB_REQ_MESSAGE, 
-                              len, struct ctdb_req_message);
-       CTDB_NO_MEMORY(ctdb, r);
-
-       r->hdr.destnode  = vnn;
-       r->srvid         = srvid;
-       r->datalen       = data.dsize;
-       memcpy(&r->data[0], data.dptr, data.dsize);
-       
-       res = ctdb_client_queue_pkt(ctdb, &r->hdr);
-       if (res != 0) {
-               return res;
-       }
-
-       talloc_free(r);
-       return 0;
-}
-
-
-/*
-  cancel a ctdb_fetch_lock operation, releasing the lock
- */
-static int fetch_lock_destructor(struct ctdb_record_handle *h)
-{
-       ctdb_ltdb_unlock(h->ctdb_db, h->key);
-       return 0;
-}
-
-/*
-  force the migration of a record to this node
- */
-static int ctdb_client_force_migration(struct ctdb_db_context *ctdb_db, TDB_DATA key)
-{
-       struct ctdb_call call;
-       ZERO_STRUCT(call);
-       call.call_id = CTDB_NULL_FUNC;
-       call.key = key;
-       call.flags = CTDB_IMMEDIATE_MIGRATION;
-       return ctdb_call(ctdb_db, &call);
-}
-
-/*
-  get a lock on a record, and return the records data. Blocks until it gets the lock
- */
-struct ctdb_record_handle *ctdb_fetch_lock(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx, 
-                                          TDB_DATA key, TDB_DATA *data)
-{
-       int ret;
-       struct ctdb_record_handle *h;
-
-       /*
-         procedure is as follows:
-
-         1) get the chain lock. 
-         2) check if we are dmaster
-         3) if we are the dmaster then return handle 
-         4) if not dmaster then ask ctdb daemon to make us dmaster, and wait for
-            reply from ctdbd
-         5) when we get the reply, goto (1)
-        */
-
-       h = talloc_zero(mem_ctx, struct ctdb_record_handle);
-       if (h == NULL) {
-               return NULL;
-       }
-
-       h->ctdb_db = ctdb_db;
-       h->key     = key;
-       h->key.dptr = (unsigned char *)talloc_memdup(h, key.dptr, key.dsize);
-       if (h->key.dptr == NULL) {
-               talloc_free(h);
-               return NULL;
-       }
-       h->data    = data;
-
-       DEBUG(3,("ctdb_fetch_lock: key=%*.*s\n", (int)key.dsize, (int)key.dsize, 
-                (const char *)key.dptr));
-
-again:
-       /* step 1 - get the chain lock */
-       ret = ctdb_ltdb_lock(ctdb_db, key);
-       if (ret != 0) {
-               DEBUG(0, (__location__ " failed to lock ltdb record\n"));
-               talloc_free(h);
-               return NULL;
-       }
-
-       DEBUG(4,("ctdb_fetch_lock: got chain lock\n"));
-
-       talloc_set_destructor(h, fetch_lock_destructor);
-
-       ret = ctdb_ltdb_fetch(ctdb_db, key, &h->header, h, data);
-
-       /* when torturing, ensure we test the remote path */
-       if ((ctdb_db->ctdb->flags & CTDB_FLAG_TORTURE) &&
-           random() % 5 == 0) {
-               h->header.dmaster = (uint32_t)-1;
-       }
-
-
-       DEBUG(4,("ctdb_fetch_lock: done local fetch\n"));
-
-       if (ret != 0 || h->header.dmaster != ctdb_db->ctdb->vnn) {
-               ctdb_ltdb_unlock(ctdb_db, key);
-               ret = ctdb_client_force_migration(ctdb_db, key);
-               if (ret != 0) {
-                       DEBUG(4,("ctdb_fetch_lock: force_migration failed\n"));
-                       talloc_free(h);
-                       return NULL;
-               }
-               goto again;
-       }
-
-       DEBUG(4,("ctdb_fetch_lock: we are dmaster - done\n"));
-       return h;
-}
-
-/*
-  store some data to the record that was locked with ctdb_fetch_lock()
-*/
-int ctdb_record_store(struct ctdb_record_handle *h, TDB_DATA data)
-{
-       return ctdb_ltdb_store(h->ctdb_db, h->key, &h->header, data);
-}
-
-/*
-  non-locking fetch of a record
- */
-int ctdb_fetch(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx, 
-              TDB_DATA key, TDB_DATA *data)
-{
-       struct ctdb_call call;
-       int ret;
-
-       call.call_id = CTDB_FETCH_FUNC;
-       call.call_data.dptr = NULL;
-       call.call_data.dsize = 0;
-
-       ret = ctdb_call(ctdb_db, &call);
-
-       if (ret == 0) {
-               *data = call.reply_data;
-               talloc_steal(mem_ctx, data->dptr);
-       }
-
-       return ret;
-}
-
-
-struct ctdb_client_control_state {
-       struct ctdb_context *ctdb;
-       uint32_t reqid;
-       int32_t status;
-       TDB_DATA outdata;
-       enum call_state state;
-       char *errormsg;
-};
-
-/*
-  called when a CTDB_REPLY_CONTROL packet comes in in the client
-
-  This packet comes in response to a CTDB_REQ_CONTROL request packet. It
-  contains any reply data from the control
-*/
-static void ctdb_client_reply_control(struct ctdb_context *ctdb, 
-                                     struct ctdb_req_header *hdr)
-{
-       struct ctdb_reply_control *c = (struct ctdb_reply_control *)hdr;
-       struct ctdb_client_control_state *state;
-
-       state = ctdb_reqid_find(ctdb, hdr->reqid, struct ctdb_client_control_state);
-       if (state == NULL) {
-               DEBUG(0,(__location__ " reqid %u not found\n", hdr->reqid));
-               return;
-       }
-
-       if (hdr->reqid != state->reqid) {
-               /* we found a record  but it was the wrong one */
-               DEBUG(0, ("Dropped orphaned reply control with reqid:%u\n",hdr->reqid));
-               return;
-       }
-
-       state->outdata.dptr = c->data;
-       state->outdata.dsize = c->datalen;
-       state->status = c->status;
-       if (c->errorlen) {
-               state->errormsg = talloc_strndup(state, 
-                                                (char *)&c->data[c->datalen], 
-                                                c->errorlen);
-       }
-
-       talloc_steal(state, c);
-
-       state->state = CTDB_CALL_DONE;
-}
-
-
-/* time out handler for ctdb_control */
-static void timeout_func(struct event_context *ev, struct timed_event *te, 
-       struct timeval t, void *private_data)
-{
-       uint32_t *timed_out = (uint32_t *)private_data;
-
-       *timed_out = 1;
-}
-
-/*
-  destroy a ctdb_control in client
-*/
-static int ctdb_control_destructor(struct ctdb_client_control_state *state)    
-{
-       ctdb_reqid_remove(state->ctdb, state->reqid);
-       return 0;
-}
-
-/*
-  send a ctdb control message
-  timeout specifies how long we should wait for a reply.
-  if timeout is NULL we wait indefinitely
- */
-int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid, 
-                uint32_t opcode, uint32_t flags, TDB_DATA data, 
-                TALLOC_CTX *mem_ctx, TDB_DATA *outdata, int32_t *status,
-                struct timeval *timeout,
-                char **errormsg)
-{
-       struct ctdb_client_control_state *state;
-       struct ctdb_req_control *c;
-       size_t len;
-       int ret;
-       uint32_t timed_out;
-
-       if (errormsg) {
-               *errormsg = NULL;
-       }
-
-       /* if the domain socket is not yet open, open it */
-       if (ctdb->daemon.sd==-1) {
-               ctdb_socket_connect(ctdb);
-       }
-
-       state = talloc_zero(ctdb, struct ctdb_client_control_state);
-       CTDB_NO_MEMORY(ctdb, state);
-
-       state->ctdb  = ctdb;
-       state->reqid = ctdb_reqid_new(ctdb, state);
-       state->state = CTDB_CALL_WAIT;
-       state->errormsg = NULL;
-
-       talloc_set_destructor(state, ctdb_control_destructor);
-
-       len = offsetof(struct ctdb_req_control, data) + data.dsize;
-       c = ctdbd_allocate_pkt(ctdb, state, CTDB_REQ_CONTROL, 
-                              len, struct ctdb_req_control);
-       CTDB_NO_MEMORY(ctdb, c);
-       
-       c->hdr.reqid        = state->reqid;
-       c->hdr.destnode     = destnode;
-       c->hdr.reqid        = state->reqid;
-       c->opcode           = opcode;
-       c->client_id        = 0;
-       c->flags            = flags;
-       c->srvid            = srvid;
-       c->datalen          = data.dsize;
-       if (data.dsize) {
-               memcpy(&c->data[0], data.dptr, data.dsize);
-       }
-
-       ret = ctdb_client_queue_pkt(ctdb, &(c->hdr));
-       if (ret != 0) {
-               talloc_free(state);
-               return -1;
-       }
-
-       if (flags & CTDB_CTRL_FLAG_NOREPLY) {
-               talloc_free(state);
-               return 0;
-       }
-
-       /* semi-async operation */
-       timed_out = 0;
-       if (timeout && !timeval_is_zero(timeout)) {
-               event_add_timed(ctdb->ev, state, *timeout, timeout_func, &timed_out);
-       }
-       while ((state->state == CTDB_CALL_WAIT)
-       &&      (timed_out == 0) ){
-               event_loop_once(ctdb->ev);
-       }
-       if (timed_out) {
-               talloc_free(state);
-               if (errormsg) {
-                       (*errormsg) = talloc_strdup(mem_ctx, "control timed out");
-               } else {
-                       DEBUG(0,("ctdb_control timed out\n"));
-               }
-               return -1;
-       }
-
-       if (outdata) {
-               *outdata = state->outdata;
-               outdata->dptr = (unsigned char *)talloc_memdup(mem_ctx, outdata->dptr, outdata->dsize);
-       }
-
-       *status = state->status;
-
-       if (!errormsg && state->errormsg) {
-               DEBUG(0,("ctdb_control error: '%s'\n", state->errormsg));
-       }
-
-       if (errormsg && state->errormsg) {
-               (*errormsg) = talloc_move(mem_ctx, &state->errormsg);
-       }
-
-       talloc_free(state);
-
-       return 0;       
-}
-
-
-
-/*
-  a process exists call. Returns 0 if process exists, -1 otherwise
- */
-int ctdb_ctrl_process_exists(struct ctdb_context *ctdb, uint32_t destnode, pid_t pid)
-{
-       int ret;
-       TDB_DATA data;
-       int32_t status;
-
-       data.dptr = (uint8_t*)&pid;
-       data.dsize = sizeof(pid);
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_PROCESS_EXISTS, 0, data, 
-                          NULL, NULL, &status, NULL, NULL);
-       if (ret != 0) {
-               DEBUG(0,(__location__ " ctdb_control for process_exists failed\n"));
-               return -1;
-       }
-
-       return status;
-}
-
-/*
-  get remote statistics
- */
-int ctdb_ctrl_statistics(struct ctdb_context *ctdb, uint32_t destnode, struct ctdb_statistics *status)
-{
-       int ret;
-       TDB_DATA data;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_STATISTICS, 0, tdb_null, 
-                          ctdb, &data, &res, NULL, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for statistics failed\n"));
-               return -1;
-       }
-
-       if (data.dsize != sizeof(struct ctdb_statistics)) {
-               DEBUG(0,(__location__ " Wrong statistics size %u - expected %u\n",
-                        (unsigned)data.dsize, (unsigned)sizeof(struct ctdb_statistics)));
-                     return -1;
-       }
-
-       *status = *(struct ctdb_statistics *)data.dptr;
-       talloc_free(data.dptr);
-                       
-       return 0;
-}
-
-/*
-  shutdown a remote ctdb node
- */
-int ctdb_ctrl_shutdown(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_SHUTDOWN, CTDB_CTRL_FLAG_NOREPLY, tdb_null, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0) {
-               DEBUG(0,(__location__ " ctdb_control for shutdown failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-/*
-  get vnn map from a remote node
- */
-int ctdb_ctrl_getvnnmap(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, struct ctdb_vnn_map **vnnmap)
-{
-       int ret;
-       TDB_DATA outdata;
-       int32_t res;
-       struct ctdb_vnn_map_wire *map;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GETVNNMAP, 0, tdb_null, 
-                          mem_ctx, &outdata, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for getvnnmap failed\n"));
-               return -1;
-       }
-       
-       map = (struct ctdb_vnn_map_wire *)outdata.dptr;
-       if (outdata.dsize < offsetof(struct ctdb_vnn_map_wire, map) ||
-           outdata.dsize != map->size*sizeof(uint32_t) + offsetof(struct ctdb_vnn_map_wire, map)) {
-               DEBUG(0,("Bad vnn map size received in ctdb_ctrl_getvnnmap\n"));
-               return -1;
-       }
-
-       (*vnnmap) = talloc(mem_ctx, struct ctdb_vnn_map);
-       CTDB_NO_MEMORY(ctdb, *vnnmap);
-       (*vnnmap)->generation = map->generation;
-       (*vnnmap)->size       = map->size;
-       (*vnnmap)->map        = talloc_array(*vnnmap, uint32_t, map->size);
-
-       CTDB_NO_MEMORY(ctdb, (*vnnmap)->map);
-       memcpy((*vnnmap)->map, map->map, sizeof(uint32_t)*map->size);
-       talloc_free(outdata.dptr);
-                   
-       return 0;
-}
-
-/*
-  get the recovery mode of a remote node
- */
-int ctdb_ctrl_getrecmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t *recmode)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_RECMODE, 0, tdb_null, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0) {
-               DEBUG(0,(__location__ " ctdb_control for getrecmode failed\n"));
-               return -1;
-       }
-
-       *recmode = res;
-
-       return 0;
-}
-
-/*
-  set the recovery mode of a remote node
- */
-int ctdb_ctrl_setrecmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t recmode)
-{
-       int ret;
-       TDB_DATA data;
-       int32_t res;
-
-       data.dsize = sizeof(uint32_t);
-       data.dptr = (unsigned char *)&recmode;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_SET_RECMODE, 0, data, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for setrecmode failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-/*
-  get the recovery master of a remote node
- */
-int ctdb_ctrl_getrecmaster(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t *recmaster)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_RECMASTER, 0, tdb_null, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0) {
-               DEBUG(0,(__location__ " ctdb_control for getrecmaster failed\n"));
-               return -1;
-       }
-
-       *recmaster = res;
-
-       return 0;
-}
-
-/*
-  set the recovery master of a remote node
- */
-int ctdb_ctrl_setrecmaster(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t recmaster)
-{
-       int ret;
-       TDB_DATA data;
-       int32_t res;
-
-       ZERO_STRUCT(data);
-       data.dsize = sizeof(uint32_t);
-       data.dptr = (unsigned char *)&recmaster;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_SET_RECMASTER, 0, data, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for setrecmaster failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-
-/*
-  get a list of databases off a remote node
- */
-int ctdb_ctrl_getdbmap(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, 
-                      TALLOC_CTX *mem_ctx, struct ctdb_dbid_map **dbmap)
-{
-       int ret;
-       TDB_DATA outdata;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_DBMAP, 0, tdb_null, 
-                          mem_ctx, &outdata, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for getdbmap failed\n"));
-               return -1;
-       }
-
-       *dbmap = (struct ctdb_dbid_map *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize);
-       talloc_free(outdata.dptr);
-                   
-       return 0;
-}
-
-
-/*
-  get a list of nodes (vnn and flags ) from a remote node
- */
-int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb, 
-               struct timeval timeout, uint32_t destnode, 
-               TALLOC_CTX *mem_ctx, struct ctdb_node_map **nodemap)
-{
-       int ret;
-       TDB_DATA outdata;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_NODEMAP, 0, tdb_null, 
-                          mem_ctx, &outdata, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for getnodes failed\n"));
-               return -1;
-       }
-
-       *nodemap = (struct ctdb_node_map *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize);
-       talloc_free(outdata.dptr);
-                   
-       return 0;
-}
-
-/*
-  set vnn map on a node
- */
-int ctdb_ctrl_setvnnmap(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, 
-                       TALLOC_CTX *mem_ctx, struct ctdb_vnn_map *vnnmap)
-{
-       int ret;
-       TDB_DATA data;
-       int32_t res;
-       struct ctdb_vnn_map_wire *map;
-       size_t len;
-
-       len = offsetof(struct ctdb_vnn_map_wire, map) + sizeof(uint32_t)*vnnmap->size;
-       map = talloc_size(mem_ctx, len);
-       CTDB_NO_MEMORY_VOID(ctdb, map);
-
-       map->generation = vnnmap->generation;
-       map->size = vnnmap->size;
-       memcpy(map->map, vnnmap->map, sizeof(uint32_t)*map->size);
-       
-       data.dsize = len;
-       data.dptr  = (uint8_t *)map;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_SETVNNMAP, 0, data, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for setvnnmap failed\n"));
-               return -1;
-       }
-
-       talloc_free(map);
-
-       return 0;
-}
-
-/*
-  get all keys and records for a specific database
- */
-int ctdb_ctrl_pulldb(struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid, uint32_t lmaster, 
-                    TALLOC_CTX *mem_ctx, struct ctdb_key_list *keys)
-{
-       int i, ret;
-       TDB_DATA indata, outdata;
-       struct ctdb_control_pulldb pull;
-       struct ctdb_control_pulldb_reply *reply;
-       struct ctdb_rec_data *rec;
-       int32_t res;
-
-       pull.db_id   = dbid;
-       pull.lmaster = lmaster;
-
-       indata.dsize = sizeof(struct ctdb_control_pulldb);
-       indata.dptr  = (unsigned char *)&pull;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_PULL_DB, 0, indata, 
-                          mem_ctx, &outdata, &res, NULL, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for pulldb failed\n"));
-               return -1;
-       }
-
-
-       reply = (struct ctdb_control_pulldb_reply *)outdata.dptr;
-       keys->dbid     = reply->db_id;
-       keys->num      = reply->count;
-       
-       keys->keys     = talloc_array(mem_ctx, TDB_DATA, keys->num);
-       keys->headers  = talloc_array(mem_ctx, struct ctdb_ltdb_header, keys->num);
-       keys->data     = talloc_array(mem_ctx, TDB_DATA, keys->num);
-
-       rec = (struct ctdb_rec_data *)&reply->data[0];
-
-       for (i=0;i<reply->count;i++) {
-               keys->keys[i].dptr = (unsigned char *)talloc_memdup(mem_ctx, &rec->data[0], rec->keylen);
-               keys->keys[i].dsize = rec->keylen;
-               
-               keys->data[i].dptr = (unsigned char *)talloc_memdup(mem_ctx, &rec->data[keys->keys[i].dsize], rec->datalen);
-               keys->data[i].dsize = rec->datalen;
-
-               if (keys->data[i].dsize < sizeof(struct ctdb_ltdb_header)) {
-                       DEBUG(0,(__location__ " bad ltdb record\n"));
-                       return -1;
-               }
-               memcpy(&keys->headers[i], keys->data[i].dptr, sizeof(struct ctdb_ltdb_header));
-               keys->data[i].dptr += sizeof(struct ctdb_ltdb_header);
-               keys->data[i].dsize -= sizeof(struct ctdb_ltdb_header);
-
-               rec = (struct ctdb_rec_data *)(rec->length + (uint8_t *)rec);
-       }           
-
-       talloc_free(outdata.dptr);
-
-       return 0;
-}
-
-/*
-  copy a tdb from one node to another node
- */
-int ctdb_ctrl_copydb(struct ctdb_context *ctdb, struct timeval timeout, uint32_t sourcenode, 
-                    uint32_t destnode, uint32_t dbid, uint32_t lmaster, TALLOC_CTX *mem_ctx)
-{
-       int ret;
-       TDB_DATA indata, outdata;
-       int32_t res;
-
-       indata.dsize = 2*sizeof(uint32_t);
-       indata.dptr  = (unsigned char *)talloc_array(mem_ctx, uint32_t, 2);
-
-       ((uint32_t *)(&indata.dptr[0]))[0] = dbid;
-       ((uint32_t *)(&indata.dptr[0]))[1] = lmaster;
-
-       DEBUG(3,("pulling dbid 0x%x from %u\n", dbid, sourcenode));
-
-       ret = ctdb_control(ctdb, sourcenode, 0, 
-                          CTDB_CONTROL_PULL_DB, 0, indata, 
-                          mem_ctx, &outdata, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for pulldb failed\n"));
-               return -1;
-       }
-
-       DEBUG(3,("pushing dbid 0x%x to %u\n", dbid, destnode));
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_PUSH_DB, 0, outdata, 
-                          mem_ctx, NULL, &res, &timeout, NULL);
-       talloc_free(outdata.dptr);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for pushdb failed\n"));
-               return -1;
-       }
-
-       DEBUG(3,("copydb for dbid 0x%x done for %u to %u\n", 
-                dbid, sourcenode, destnode));
-
-       return 0;
-}
-
-/*
-  change dmaster for all keys in the database to the new value
- */
-int ctdb_ctrl_setdmaster(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, 
-                        TALLOC_CTX *mem_ctx, uint32_t dbid, uint32_t dmaster)
-{
-       int ret;
-       TDB_DATA indata;
-       int32_t res;
-
-       indata.dsize = 2*sizeof(uint32_t);
-       indata.dptr = (unsigned char *)talloc_array(mem_ctx, uint32_t, 2);
-
-       ((uint32_t *)(&indata.dptr[0]))[0] = dbid;
-       ((uint32_t *)(&indata.dptr[0]))[1] = dmaster;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_SET_DMASTER, 0, indata, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for setdmaster failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-/*
-  ping a node, return number of clients connected
- */
-int ctdb_ctrl_ping(struct ctdb_context *ctdb, uint32_t destnode)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_PING, 0, 
-                          tdb_null, NULL, NULL, &res, NULL, NULL);
-       if (ret != 0) {
-               return -1;
-       }
-       return res;
-}
-
-/*
-  find the real path to a ltdb 
- */
-int ctdb_ctrl_getdbpath(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t dbid, TALLOC_CTX *mem_ctx, 
-                  const char **path)
-{
-       int ret;
-       int32_t res;
-       TDB_DATA data;
-
-       data.dptr = (uint8_t *)&dbid;
-       data.dsize = sizeof(dbid);
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GETDBPATH, 0, data, 
-                          mem_ctx, &data, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               return -1;
-       }
-
-       (*path) = talloc_strndup(mem_ctx, (const char *)data.dptr, data.dsize);
-       if ((*path) == NULL) {
-               return -1;
-       }
-
-       talloc_free(data.dptr);
-
-       return 0;
-}
-
-/*
-  find the name of a db 
- */
-int ctdb_ctrl_getdbname(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t dbid, TALLOC_CTX *mem_ctx, 
-                  const char **name)
-{
-       int ret;
-       int32_t res;
-       TDB_DATA data;
-
-       data.dptr = (uint8_t *)&dbid;
-       data.dsize = sizeof(dbid);
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_DBNAME, 0, data, 
-                          mem_ctx, &data, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               return -1;
-       }
-
-       (*name) = talloc_strndup(mem_ctx, (const char *)data.dptr, data.dsize);
-       if ((*name) == NULL) {
-               return -1;
-       }
-
-       talloc_free(data.dptr);
-
-       return 0;
-}
-
-/*
-  create a database
- */
-int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, const char *name)
-{
-       int ret;
-       int32_t res;
-       TDB_DATA data;
-
-       data.dptr = (unsigned char *)discard_const(name);
-       data.dsize = strlen(name)+1;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_DB_ATTACH, 0, data, 
-                          mem_ctx, &data, &res, &timeout, NULL);
-
-       if (ret != 0 || res != 0) {
-               return -1;
-       }
-
-       return 0;
-}
-
-/*
-  get debug level on a node
- */
-int ctdb_ctrl_get_debuglevel(struct ctdb_context *ctdb, uint32_t destnode, uint32_t *level)
-{
-       int ret;
-       int32_t res;
-       TDB_DATA data;
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_GET_DEBUG, 0, tdb_null, 
-                          ctdb, &data, &res, NULL, NULL);
-       if (ret != 0 || res != 0) {
-               return -1;
-       }
-       if (data.dsize != sizeof(uint32_t)) {
-               DEBUG(0,("Bad control reply size in ctdb_get_debuglevel (got %u)\n",
-                        (unsigned)data.dsize));
-               return -1;
-       }
-       *level = *(uint32_t *)data.dptr;
-       talloc_free(data.dptr);
-       return 0;
-}
-
-/*
-  set debug level on a node
- */
-int ctdb_ctrl_set_debuglevel(struct ctdb_context *ctdb, uint32_t destnode, uint32_t level)
-{
-       int ret;
-       int32_t res;
-       TDB_DATA data;
-
-       data.dptr = (uint8_t *)&level;
-       data.dsize = sizeof(level);
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_SET_DEBUG, 0, data, 
-                          NULL, NULL, &res, NULL, NULL);
-       if (ret != 0 || res != 0) {
-               return -1;
-       }
-       return 0;
-}
-
-
-/*
-  get a list of connected nodes
- */
-uint32_t *ctdb_get_connected_nodes(struct ctdb_context *ctdb, 
-                               struct timeval timeout,
-                               TALLOC_CTX *mem_ctx,
-                               uint32_t *num_nodes)
-{
-       struct ctdb_node_map *map=NULL;
-       int ret, i;
-       uint32_t *nodes;
-
-       *num_nodes = 0;
-
-       ret = ctdb_ctrl_getnodemap(ctdb, timeout, CTDB_CURRENT_NODE, mem_ctx, &map);
-       if (ret != 0) {
-               return NULL;
-       }
-
-       nodes = talloc_array(mem_ctx, uint32_t, map->num);
-       if (nodes == NULL) {
-               return NULL;
-       }
-
-       for (i=0;i<map->num;i++) {
-               if (!(map->nodes[i].flags & NODE_FLAGS_DISCONNECTED)) {
-                       nodes[*num_nodes] = map->nodes[i].vnn;
-                       (*num_nodes)++;
-               }
-       }
-
-       return nodes;
-}
-
-
-/*
-  reset remote status
- */
-int ctdb_statistics_reset(struct ctdb_context *ctdb, uint32_t destnode)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_STATISTICS_RESET, 0, tdb_null, 
-                          NULL, NULL, &res, NULL, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for reset statistics failed\n"));
-               return -1;
-       }
-       return 0;
-}
-
-
-/*
-  attach to a specific database - client call
-*/
-struct ctdb_db_context *ctdb_attach(struct ctdb_context *ctdb, const char *name)
-{
-       struct ctdb_db_context *ctdb_db;
-       TDB_DATA data;
-       int ret;
-       int32_t res;
-
-       ctdb_db = ctdb_db_handle(ctdb, name);
-       if (ctdb_db) {
-               return ctdb_db;
-       }
-
-       ctdb_db = talloc_zero(ctdb, struct ctdb_db_context);
-       CTDB_NO_MEMORY_NULL(ctdb, ctdb_db);
-
-       ctdb_db->ctdb = ctdb;
-       ctdb_db->db_name = talloc_strdup(ctdb_db, name);
-       CTDB_NO_MEMORY_NULL(ctdb, ctdb_db->db_name);
-
-       data.dptr = (unsigned char *)discard_const(name);
-       data.dsize = strlen(name)+1;
-
-       /* tell ctdb daemon to attach */
-       ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0, CTDB_CONTROL_DB_ATTACH,
-                          0, data, ctdb_db, &data, &res, NULL, NULL);
-       if (ret != 0 || res != 0 || data.dsize != sizeof(uint32_t)) {
-               DEBUG(0,("Failed to attach to database '%s'\n", name));
-               talloc_free(ctdb_db);
-               return NULL;
-       }
-       
-       ctdb_db->db_id = *(uint32_t *)data.dptr;
-       talloc_free(data.dptr);
-
-       ret = ctdb_ctrl_getdbpath(ctdb, timeval_current_ofs(2, 0), CTDB_CURRENT_NODE, ctdb_db->db_id, ctdb_db, &ctdb_db->db_path);
-       if (ret != 0) {
-               DEBUG(0,("Failed to get dbpath for database '%s'\n", name));
-               talloc_free(ctdb_db);
-               return NULL;
-       }
-
-       ctdb_db->ltdb = tdb_wrap_open(ctdb, ctdb_db->db_path, 0, 0, O_RDWR, 0);
-       if (ctdb_db->ltdb == NULL) {
-               ctdb_set_error(ctdb, "Failed to open tdb '%s'\n", ctdb_db->db_path);
-               talloc_free(ctdb_db);
-               return NULL;
-       }
-
-       DLIST_ADD(ctdb->db_list, ctdb_db);
-
-       return ctdb_db;
-}
-
-
-/*
-  setup a call for a database
- */
-int ctdb_set_call(struct ctdb_db_context *ctdb_db, ctdb_fn_t fn, uint32_t id)
-{
-       TDB_DATA data;
-       int32_t status;
-       struct ctdb_control_set_call c;
-       int ret;
-       struct ctdb_registered_call *call;
-
-       c.db_id = ctdb_db->db_id;
-       c.fn    = fn;
-       c.id    = id;
-
-       data.dptr = (uint8_t *)&c;
-       data.dsize = sizeof(c);
-
-       ret = ctdb_control(ctdb_db->ctdb, CTDB_CURRENT_NODE, 0, CTDB_CONTROL_SET_CALL, 0,
-                          data, NULL, NULL, &status, NULL, NULL);
-       if (ret != 0 || status != 0) {
-               DEBUG(0,("ctdb_set_call failed for call %u\n", id));
-               return -1;
-       }
-
-       /* also register locally */
-       call = talloc(ctdb_db, struct ctdb_registered_call);
-       call->fn = fn;
-       call->id = id;
-
-       DLIST_ADD(ctdb_db->calls, call);        
-       return 0;
-}
-
-
-struct traverse_state {
-       bool done;
-       uint32_t count;
-       ctdb_traverse_func fn;
-       void *private_data;
-};
-
-/*
-  called on each key during a ctdb_traverse
- */
-static void traverse_handler(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA data, void *p)
-{
-       struct traverse_state *state = (struct traverse_state *)p;
-       struct ctdb_rec_data *d = (struct ctdb_rec_data *)data.dptr;
-       TDB_DATA key;
-
-       if (data.dsize < sizeof(uint32_t) ||
-           d->length != data.dsize) {
-               DEBUG(0,("Bad data size %u in traverse_handler\n", (unsigned)data.dsize));
-               state->done = true;
-               return;
-       }
-
-       key.dsize = d->keylen;
-       key.dptr  = &d->data[0];
-       data.dsize = d->datalen;
-       data.dptr = &d->data[d->keylen];
-
-       if (key.dsize == 0 && data.dsize == 0) {
-               /* end of traverse */
-               state->done = true;
-               return;
-       }
-
-       if (state->fn(ctdb, key, data, state->private_data) != 0) {
-               state->done = true;
-       }
-
-       state->count++;
-}
-
-
-/*
-  start a cluster wide traverse, calling the supplied fn on each record
-  return the number of records traversed, or -1 on error
- */
-int ctdb_traverse(struct ctdb_db_context *ctdb_db, ctdb_traverse_func fn, void *private_data)
-{
-       TDB_DATA data;
-       struct ctdb_traverse_start t;
-       int32_t status;
-       int ret;
-       uint64_t srvid = (getpid() | 0xFLL<<60);
-       struct traverse_state state;
-
-       state.done = false;
-       state.count = 0;
-       state.private_data = private_data;
-       state.fn = fn;
-
-       ret = ctdb_set_message_handler(ctdb_db->ctdb, srvid, traverse_handler, &state);
-       if (ret != 0) {
-               DEBUG(0,("Failed to setup traverse handler\n"));
-               return -1;
-       }
-
-       t.db_id = ctdb_db->db_id;
-       t.srvid = srvid;
-       t.reqid = 0;
-
-       data.dptr = (uint8_t *)&t;
-       data.dsize = sizeof(t);
-
-       ret = ctdb_control(ctdb_db->ctdb, CTDB_CURRENT_NODE, 0, CTDB_CONTROL_TRAVERSE_START, 0,
-                          data, NULL, NULL, &status, NULL, NULL);
-       if (ret != 0 || status != 0) {
-               DEBUG(0,("ctdb_traverse_all failed\n"));
-               ctdb_remove_message_handler(ctdb_db->ctdb, srvid, &state);
-               return -1;
-       }
-
-       while (!state.done) {
-               event_loop_once(ctdb_db->ctdb->ev);
-       }
-
-       ret = ctdb_remove_message_handler(ctdb_db->ctdb, srvid, &state);
-       if (ret != 0) {
-               DEBUG(0,("Failed to remove ctdb_traverse handler\n"));
-               return -1;
-       }
-
-       return state.count;
-}
-
-/*
-  called on each key during a catdb
- */
-static int dumpdb_fn(struct ctdb_context *ctdb, TDB_DATA key, TDB_DATA data, void *p)
-{
-       FILE *f = (FILE *)p;
-       char *keystr, *datastr;
-       struct ctdb_ltdb_header *h = (struct ctdb_ltdb_header *)data.dptr;
-
-       keystr  = hex_encode_talloc(ctdb, key.dptr, key.dsize);
-       datastr = hex_encode_talloc(ctdb, data.dptr+sizeof(*h), data.dsize-sizeof(*h));
-
-       fprintf(f, "dmaster: %u\n", h->dmaster);
-       fprintf(f, "rsn: %llu\n", (unsigned long long)h->rsn);
-       fprintf(f, "key: %s\ndata: %s\n", keystr, datastr);
-
-       talloc_free(keystr);
-       talloc_free(datastr);
-       return 0;
-}
-
-/*
-  convenience function to list all keys to stdout
- */
-int ctdb_dump_db(struct ctdb_db_context *ctdb_db, FILE *f)
-{
-       return ctdb_traverse(ctdb_db, dumpdb_fn, f);
-}
-
-/*
-  get the pid of a ctdb daemon
- */
-int ctdb_ctrl_getpid(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t *pid)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_PID, 0, tdb_null, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0) {
-               DEBUG(0,(__location__ " ctdb_control for getpid failed\n"));
-               return -1;
-       }
-
-       *pid = res;
-
-       return 0;
-}
-
-
-/*
-  freeze a node
- */
-int ctdb_ctrl_freeze(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_FREEZE, 0, tdb_null, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control freeze failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-/*
-  thaw a node
- */
-int ctdb_ctrl_thaw(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_THAW, 0, tdb_null, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control thaw failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-/*
-  get vnn of a node, or -1
- */
-int ctdb_ctrl_getvnn(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_VNN, 0, tdb_null, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0) {
-               DEBUG(0,(__location__ " ctdb_control for getvnn failed\n"));
-               return -1;
-       }
-
-       return res;
-}
-
-/*
-  set the monitoring mode of a remote node
- */
-int ctdb_ctrl_setmonmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t monmode)
-{
-       int ret;
-       TDB_DATA data;
-       int32_t res;
-
-       data.dsize = sizeof(uint32_t);
-       data.dptr = (uint8_t *)&monmode;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_SET_MONMODE, 0, data, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for setmonmode failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-/*
-  get the monitoring mode of a remote node
- */
-int ctdb_ctrl_getmonmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t *monmode)
-{
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_MONMODE, 0, tdb_null, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0) {
-               DEBUG(0,(__location__ " ctdb_control for getrecmode failed\n"));
-               return -1;
-       }
-
-       *monmode = res;
-
-       return 0;
-}
-
-
-/*
-  get maximum rsn for a db on a node
- */
-int ctdb_ctrl_get_max_rsn(struct ctdb_context *ctdb, struct timeval timeout, 
-                         uint32_t destnode, uint32_t db_id, uint64_t *max_rsn)
-{
-       TDB_DATA data, outdata;
-       int ret;
-       int32_t res;
-
-       data.dptr = (uint8_t *)&db_id;
-       data.dsize = sizeof(db_id);
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_MAX_RSN, 0, data, ctdb,
-                          &outdata, &res, &timeout, NULL);
-       if (ret != 0 || res != 0 || outdata.dsize != sizeof(uint64_t)) {
-               DEBUG(0,(__location__ " ctdb_control for get_max_rsn failed\n"));
-               return -1;
-       }
-
-       *max_rsn = *(uint64_t *)outdata.dptr;
-       talloc_free(outdata.dptr);
-
-       return 0;       
-}
-
-/*
-  set the rsn on non-empty records to the given rsn
- */
-int ctdb_ctrl_set_rsn_nonempty(struct ctdb_context *ctdb, struct timeval timeout, 
-                              uint32_t destnode, uint32_t db_id, uint64_t rsn)
-{
-       TDB_DATA data;
-       int ret;
-       int32_t res;
-       struct ctdb_control_set_rsn_nonempty p;
-
-       p.db_id = db_id;
-       p.rsn = rsn;
-
-       data.dptr = (uint8_t *)&p;
-       data.dsize = sizeof(p);
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_SET_RSN_NONEMPTY, 0, data, NULL,
-                          NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for set_rsn_nonempty failed\n"));
-               return -1;
-       }
-
-       return 0;       
-}
-
-/*
-  delete records which have a rsn below the given rsn
- */
-int ctdb_ctrl_delete_low_rsn(struct ctdb_context *ctdb, struct timeval timeout, 
-                            uint32_t destnode, uint32_t db_id, uint64_t rsn)
-{
-       TDB_DATA data;
-       int ret;
-       int32_t res;
-       struct ctdb_control_delete_low_rsn p;
-
-       p.db_id = db_id;
-       p.rsn = rsn;
-
-       data.dptr = (uint8_t *)&p;
-       data.dsize = sizeof(p);
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_DELETE_LOW_RSN, 0, data, NULL,
-                          NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for delete_low_rsn failed\n"));
-               return -1;
-       }
-
-       return 0;       
-}
-
-/* 
-  sent to a node to make it take over an ip address
-*/
-int ctdb_ctrl_takeover_ip(struct ctdb_context *ctdb, struct timeval timeout, 
-                         uint32_t destnode, struct ctdb_public_ip *ip)
-{
-       TDB_DATA data;
-       int ret;
-       int32_t res;
-
-       data.dsize = sizeof(*ip);
-       data.dptr  = (uint8_t *)ip;
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_TAKEOVER_IP, 0, data, NULL,
-                          NULL, &res, &timeout, NULL);
-
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for takeover_ip failed\n"));
-               return -1;
-       }
-
-       return 0;       
-}
-
-
-/* 
-  sent to a node to make it release an ip address
-*/
-int ctdb_ctrl_release_ip(struct ctdb_context *ctdb, struct timeval timeout, 
-                        uint32_t destnode, struct ctdb_public_ip *ip)
-{
-       TDB_DATA data;
-       int ret;
-       int32_t res;
-
-       data.dsize = sizeof(*ip);
-       data.dptr  = (uint8_t *)ip;
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_RELEASE_IP, 0, data, NULL,
-                          NULL, &res, &timeout, NULL);
-
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for release_ip failed\n"));
-               return -1;
-       }
-
-       return 0;       
-}
-
-
-/*
-  get a tunable
- */
-int ctdb_ctrl_get_tunable(struct ctdb_context *ctdb, 
-                         struct timeval timeout, 
-                         uint32_t destnode,
-                         const char *name, uint32_t *value)
-{
-       struct ctdb_control_get_tunable *t;
-       TDB_DATA data, outdata;
-       int32_t res;
-       int ret;
-
-       data.dsize = offsetof(struct ctdb_control_get_tunable, name) + strlen(name) + 1;
-       data.dptr  = (unsigned char *)talloc_size(ctdb, data.dsize);
-       CTDB_NO_MEMORY(ctdb, data.dptr);
-
-       t = (struct ctdb_control_get_tunable *)data.dptr;
-       t->length = strlen(name)+1;
-       memcpy(t->name, name, t->length);
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_GET_TUNABLE, 0, data, ctdb,
-                          &outdata, &res, &timeout, NULL);
-       talloc_free(data.dptr);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for get_tunable failed\n"));
-               return -1;
-       }
-
-       if (outdata.dsize != sizeof(uint32_t)) {
-               DEBUG(0,("Invalid return data in get_tunable\n"));
-               talloc_free(outdata.dptr);
-               return -1;
-       }
-       
-       *value = *(uint32_t *)outdata.dptr;
-       talloc_free(outdata.dptr);
-
-       return 0;
-}
-
-/*
-  set a tunable
- */
-int ctdb_ctrl_set_tunable(struct ctdb_context *ctdb, 
-                         struct timeval timeout, 
-                         uint32_t destnode,
-                         const char *name, uint32_t value)
-{
-       struct ctdb_control_set_tunable *t;
-       TDB_DATA data;
-       int32_t res;
-       int ret;
-
-       data.dsize = offsetof(struct ctdb_control_set_tunable, name) + strlen(name) + 1;
-       data.dptr  = talloc_array(ctdb, unsigned char, data.dsize);
-       CTDB_NO_MEMORY(ctdb, data.dptr);
-
-       t = (struct ctdb_control_set_tunable *)data.dptr;
-       t->length = strlen(name)+1;
-       memcpy(t->name, name, t->length);
-       t->value = value;
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_SET_TUNABLE, 0, data, NULL,
-                          NULL, &res, &timeout, NULL);
-       talloc_free(data.dptr);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for set_tunable failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-/*
-  list tunables
- */
-int ctdb_ctrl_list_tunables(struct ctdb_context *ctdb, 
-                           struct timeval timeout, 
-                           uint32_t destnode,
-                           TALLOC_CTX *mem_ctx,
-                           const char ***list, uint32_t *count)
-{
-       TDB_DATA outdata;
-       int32_t res;
-       int ret;
-       struct ctdb_control_list_tunable *t;
-       char *p, *s, *ptr;
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_LIST_TUNABLES, 0, tdb_null, 
-                          mem_ctx, &outdata, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for list_tunables failed\n"));
-               return -1;
-       }
-
-       t = (struct ctdb_control_list_tunable *)outdata.dptr;
-       if (outdata.dsize < offsetof(struct ctdb_control_list_tunable, data) ||
-           t->length > outdata.dsize-offsetof(struct ctdb_control_list_tunable, data)) {
-               DEBUG(0,("Invalid data in list_tunables reply\n"));
-               talloc_free(outdata.dptr);
-               return -1;              
-       }
-       
-       p = talloc_strndup(mem_ctx, (char *)t->data, t->length);
-       CTDB_NO_MEMORY(ctdb, p);
-
-       talloc_free(outdata.dptr);
-       
-       (*list) = NULL;
-       (*count) = 0;
-
-       for (s=strtok_r(p, ":", &ptr); s; s=strtok_r(NULL, ":", &ptr)) {
-               (*list) = talloc_realloc(mem_ctx, *list, const char *, 1+(*count));
-               CTDB_NO_MEMORY(ctdb, *list);
-               (*list)[*count] = talloc_strdup(*list, s);
-               CTDB_NO_MEMORY(ctdb, (*list)[*count]);
-               (*count)++;
-       }
-
-       talloc_free(p);
-
-       return 0;
-}
-
-
-int ctdb_ctrl_get_public_ips(struct ctdb_context *ctdb, 
-                       struct timeval timeout, uint32_t destnode, 
-                       TALLOC_CTX *mem_ctx, struct ctdb_all_public_ips **ips)
-{
-       int ret;
-       TDB_DATA outdata;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_PUBLIC_IPS, 0, tdb_null, 
-                          mem_ctx, &outdata, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for getpublicips failed\n"));
-               return -1;
-       }
-
-       *ips = (struct ctdb_all_public_ips *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize);
-       talloc_free(outdata.dptr);
-                   
-       return 0;
-}
-
-/*
-  set/clear the permanent disabled bit on a remote node
- */
-int ctdb_ctrl_modflags(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, 
-                      uint32_t set, uint32_t clear)
-{
-       int ret;
-       TDB_DATA data;
-       struct ctdb_node_modflags m;
-       int32_t res;
-
-       m.set = set;
-       m.clear = clear;
-
-       data.dsize = sizeof(m);
-       data.dptr = (unsigned char *)&m;
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_MODIFY_FLAGS, 0, data, 
-                          NULL, NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for modflags failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-
-/*
-  get all tunables
- */
-int ctdb_ctrl_get_all_tunables(struct ctdb_context *ctdb, 
-                              struct timeval timeout, 
-                              uint32_t destnode,
-                              struct ctdb_tunable *tunables)
-{
-       TDB_DATA outdata;
-       int ret;
-       int32_t res;
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_GET_ALL_TUNABLES, 0, tdb_null, ctdb,
-                          &outdata, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for get all tunables failed\n"));
-               return -1;
-       }
-
-       if (outdata.dsize != sizeof(*tunables)) {
-               DEBUG(0,(__location__ " bad data size %u in ctdb_ctrl_get_all_tunables should be %u\n",
-                        (unsigned)outdata.dsize, (unsigned)sizeof(*tunables)));
-               return -1;              
-       }
-
-       *tunables = *(struct ctdb_tunable *)outdata.dptr;
-       talloc_free(outdata.dptr);
-       return 0;
-}
-
-
-/*
-  kill a tcp connection
- */
-int ctdb_ctrl_killtcp(struct ctdb_context *ctdb, 
-                     struct timeval timeout, 
-                     uint32_t destnode,
-                     struct ctdb_control_killtcp *killtcp)
-{
-       TDB_DATA data;
-       int32_t res;
-       int ret;
-
-       data.dsize = sizeof(struct ctdb_control_killtcp);
-       data.dptr  = (unsigned char *)killtcp;
-
-       ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_KILL_TCP, 0, data, NULL,
-                          NULL, &res, &timeout, NULL);
-       if (ret != 0 || res != 0) {
-               DEBUG(0,(__location__ " ctdb_control for killtcp failed\n"));
-               return -1;
-       }
-
-       return 0;
-}
-
-/*
-  get a list of all tcp tickles that a node knows about for a particular vnn
- */
-int ctdb_ctrl_get_tcp_tickles(struct ctdb_context *ctdb, 
-                             struct timeval timeout, uint32_t destnode, 
-                             TALLOC_CTX *mem_ctx, uint32_t vnn,
-                             struct ctdb_control_tcp_tickle_list **list)
-{
-       int ret;
-       TDB_DATA data, outdata;
-       int32_t status;
-
-       data.dptr = (uint8_t*)&vnn;
-       data.dsize = sizeof(vnn);
-
-       ret = ctdb_control(ctdb, destnode, 0, 
-                          CTDB_CONTROL_GET_TCP_TICKLE_LIST, 0, data, 
-                          mem_ctx, &outdata, &status, NULL, NULL);
-       if (ret != 0) {
-               DEBUG(0,(__location__ " ctdb_control for get tcp tickles failed\n"));
-               return -1;
-       }
-
-       *list = (struct ctdb_control_tcp_tickle_list *)outdata.dptr;
-
-       return status;
-}
-
-/*
-  initialise the ctdb daemon for client applications
-
-  NOTE: In current code the daemon does not fork. This is for testing purposes only
-  and to simplify the code.
-*/
-struct ctdb_context *ctdb_init(struct event_context *ev)
-{
-       struct ctdb_context *ctdb;
-
-       ctdb = talloc_zero(ev, struct ctdb_context);
-       ctdb->ev  = ev;
-       ctdb->idr = idr_init(ctdb);
-       CTDB_NO_MEMORY_NULL(ctdb, ctdb->idr);
-
-       ctdb_set_socketname(ctdb, CTDB_PATH);
-
-       return ctdb;
-}
-
-
-/*
-  set some ctdb flags
-*/
-void ctdb_set_flags(struct ctdb_context *ctdb, unsigned flags)
-{
-       ctdb->flags |= flags;
-}
-
-/*
-  setup the local socket name
-*/
-int ctdb_set_socketname(struct ctdb_context *ctdb, const char *socketname)
-{
-       ctdb->daemon.name = talloc_strdup(ctdb, socketname);
-       return 0;
-}
-
-/*
-  return the vnn of this node
-*/
-uint32_t ctdb_get_vnn(struct ctdb_context *ctdb)
-{
-       return ctdb->vnn;
-}
-
diff --git a/source4/cluster/ctdb/common/cmdline.c b/source4/cluster/ctdb/common/cmdline.c
deleted file mode 100644 (file)
index df01110..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/* 
-   common commandline code to ctdb test tools
-
-   Copyright (C) Andrew Tridgell  2007
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "lib/events/events.h"
-#include "system/filesys.h"
-#include "popt.h"
-#include "../include/ctdb.h"
-#include "../include/ctdb_private.h"
-
-/* Handle common command line options for ctdb test progs
- */
-
-static struct {
-       const char *socketname;
-       int torture;
-       const char *events;
-} ctdb_cmdline = {
-       .socketname = CTDB_PATH,
-       .torture = 0,
-};
-
-enum {OPT_EVENTSYSTEM=1};
-
-static void ctdb_cmdline_callback(poptContext con, 
-                                 enum poptCallbackReason reason,
-                                 const struct poptOption *opt,
-                                 const char *arg, const void *data)
-{
-       switch (opt->val) {
-       case OPT_EVENTSYSTEM:
-               event_set_default_backend(arg);
-               break;
-       }
-}
-
-
-struct poptOption popt_ctdb_cmdline[] = {
-       { NULL, 0, POPT_ARG_CALLBACK, (void *)ctdb_cmdline_callback },  
-       { "socket", 0, POPT_ARG_STRING, &ctdb_cmdline.socketname, 0, "local socket name", "filename" },
-       { "debug", 'd', POPT_ARG_INT, &LogLevel, 0, "debug level"},
-       { "torture", 0, POPT_ARG_NONE, &ctdb_cmdline.torture, 0, "enable nastiness in library", NULL },
-       { "events", 0, POPT_ARG_STRING, NULL, OPT_EVENTSYSTEM, "event system", NULL },
-       { NULL }
-};
-
-
-/*
-  startup daemon side of ctdb according to command line options
- */
-struct ctdb_context *ctdb_cmdline_init(struct event_context *ev)
-{
-       struct ctdb_context *ctdb;
-       int ret;
-
-       /* initialise ctdb */
-       ctdb = ctdb_init(ev);
-       if (ctdb == NULL) {
-               printf("Failed to init ctdb\n");
-               exit(1);
-       }
-
-       if (ctdb_cmdline.torture) {
-               ctdb_set_flags(ctdb, CTDB_FLAG_TORTURE);
-       }
-
-       /* tell ctdb the socket address */
-       ret = ctdb_set_socketname(ctdb, ctdb_cmdline.socketname);
-       if (ret == -1) {
-               printf("ctdb_set_socketname failed - %s\n", ctdb_errstr(ctdb));
-               exit(1);
-       }
-
-       return ctdb;
-}
-
-
-/*
-  startup a client only ctdb context
- */
-struct ctdb_context *ctdb_cmdline_client(struct event_context *ev)
-{
-       struct ctdb_context *ctdb;
-       int ret;
-
-       /* initialise ctdb */
-       ctdb = ctdb_init(ev);
-       if (ctdb == NULL) {
-               fprintf(stderr, "Failed to init ctdb\n");
-               exit(1);
-       }
-
-       /* tell ctdb the socket address */
-       ret = ctdb_set_socketname(ctdb, ctdb_cmdline.socketname);
-       if (ret == -1) {
-               fprintf(stderr, "ctdb_set_socketname failed - %s\n", ctdb_errstr(ctdb));
-               exit(1);
-       }
-
-       ret = ctdb_socket_connect(ctdb);
-       if (ret != 0) {
-               fprintf(stderr, __location__ " Failed to connect to daemon\n");
-               talloc_free(ctdb);
-               return NULL;
-       }
-
-       /* get our vnn */
-       ctdb->vnn = ctdb_ctrl_getvnn(ctdb, timeval_zero(), CTDB_CURRENT_NODE);
-       if (ctdb->vnn == (uint32_t)-1) {
-               DEBUG(0,(__location__ " Failed to get ctdb vnn\n"));
-               talloc_free(ctdb);
-               return NULL;
-       }
-
-       return ctdb;
-}
diff --git a/source4/cluster/ctdb/common/ctdb_io.c b/source4/cluster/ctdb/common/ctdb_io.c
deleted file mode 100644 (file)
index 9116bd6..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-/* 
-   ctdb database library
-   Utility functions to read/write blobs of data from a file descriptor
-   and handle the case where we might need multiple read/writes to get all the
-   data.
-
-   Copyright (C) Andrew Tridgell  2006
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "../tdb/include/tdb.h"
-#include "lib/events/events.h"
-#include "../lib/util/dlinklist.h"
-#include "system/network.h"
-#include "system/filesys.h"
-#include "../include/ctdb_private.h"
-#include "../include/ctdb.h"
-
-/* structures for packet queueing - see common/ctdb_io.c */
-struct ctdb_partial {
-       uint8_t *data;
-       uint32_t length;
-};
-
-struct ctdb_queue_pkt {
-       struct ctdb_queue_pkt *next, *prev;
-       uint8_t *data;
-       uint32_t length;
-       uint32_t full_length;
-};
-
-struct ctdb_queue {
-       struct ctdb_context *ctdb;
-       struct ctdb_partial partial; /* partial input packet */
-       struct ctdb_queue_pkt *out_queue;
-       struct fd_event *fde;
-       int fd;
-       size_t alignment;
-       void *private_data;
-       ctdb_queue_cb_fn_t callback;
-};
-
-
-
-/*
-  called when an incoming connection is readable
-*/
-static void queue_io_read(struct ctdb_queue *queue)
-{
-       int num_ready = 0;
-       ssize_t nread;
-       uint8_t *data, *data_base;
-
-       if (ioctl(queue->fd, FIONREAD, &num_ready) != 0) {
-               return;
-       }
-       if (num_ready == 0) {
-               /* the descriptor has been closed */
-               goto failed;
-       }
-
-
-       queue->partial.data = talloc_realloc(queue, queue->partial.data, 
-                                            uint8_t, 
-                                            num_ready + queue->partial.length);
-
-       if (queue->partial.data == NULL) {
-               DEBUG(0,("read error alloc failed for %u\n", 
-                        num_ready + queue->partial.length));
-               goto failed;
-       }
-
-       nread = read(queue->fd, queue->partial.data + queue->partial.length, num_ready);
-       if (nread <= 0) {
-               DEBUG(0,("read error nread=%d\n", (int)nread));
-               goto failed;
-       }
-
-
-       data = queue->partial.data;
-       nread += queue->partial.length;
-
-       queue->partial.data = NULL;
-       queue->partial.length = 0;
-
-       if (nread >= 4 && *(uint32_t *)data == nread) {
-               /* it is the responsibility of the incoming packet
-                function to free 'data' */
-               queue->callback(data, nread, queue->private_data);
-               return;
-       }
-
-       data_base = data;
-
-       while (nread >= 4 && *(uint32_t *)data <= nread) {
-               /* we have at least one packet */
-               uint8_t *d2;
-               uint32_t len;
-               len = *(uint32_t *)data;
-               if (len == 0) {
-                       /* bad packet! treat as EOF */
-                       DEBUG(0,("Invalid packet of length 0\n"));
-                       goto failed;
-               }
-               d2 = (uint8_t *)talloc_memdup(queue, data, len);
-               if (d2 == NULL) {
-                       DEBUG(0,("read error memdup failed for %u\n", len));
-                       /* sigh */
-                       goto failed;
-               }
-               queue->callback(d2, len, queue->private_data);
-               data += len;
-               nread -= len;           
-       }
-
-       if (nread > 0) {
-               /* we have only part of a packet */
-               if (data_base == data) {
-                       queue->partial.data = data;
-                       queue->partial.length = nread;
-               } else {
-                       queue->partial.data = (uint8_t *)talloc_memdup(queue, data, nread);
-                       if (queue->partial.data == NULL) {
-                               DEBUG(0,("read error memdup partial failed for %u\n", 
-                                        (unsigned)nread));
-                               goto failed;
-                       }
-                       queue->partial.length = nread;
-                       talloc_free(data_base);
-               }
-               return;
-       }
-
-       talloc_free(data_base);
-       return;
-
-failed:
-       queue->callback(NULL, 0, queue->private_data);
-}
-
-
-/* used when an event triggers a dead queue */
-static void queue_dead(struct event_context *ev, struct timed_event *te, 
-                      struct timeval t, void *private_data)
-{
-       struct ctdb_queue *queue = talloc_get_type(private_data, struct ctdb_queue);
-       queue->callback(NULL, 0, queue->private_data);
-}
-
-
-/*
-  called when an incoming connection is writeable
-*/
-static void queue_io_write(struct ctdb_queue *queue)
-{
-       while (queue->out_queue) {
-               struct ctdb_queue_pkt *pkt = queue->out_queue;
-               ssize_t n;
-               if (queue->ctdb->flags & CTDB_FLAG_TORTURE) {
-                       n = write(queue->fd, pkt->data, 1);
-               } else {
-                       n = write(queue->fd, pkt->data, pkt->length);
-               }
-
-               if (n == -1 && errno != EAGAIN && errno != EWOULDBLOCK) {
-                       if (pkt->length != pkt->full_length) {
-                               /* partial packet sent - we have to drop it */
-                               DLIST_REMOVE(queue->out_queue, pkt);
-                               talloc_free(pkt);
-                       }
-                       talloc_free(queue->fde);
-                       queue->fde = NULL;
-                       queue->fd = -1;
-                       event_add_timed(queue->ctdb->ev, queue, timeval_zero(), 
-                                       queue_dead, queue);
-                       return;
-               }
-               if (n <= 0) return;
-               
-               if (n != pkt->length) {
-                       pkt->length -= n;
-                       pkt->data += n;
-                       return;
-               }
-
-               DLIST_REMOVE(queue->out_queue, pkt);
-               talloc_free(pkt);
-       }
-
-       EVENT_FD_NOT_WRITEABLE(queue->fde);
-}
-
-/*
-  called when an incoming connection is readable or writeable
-*/
-static void queue_io_handler(struct event_context *ev, struct fd_event *fde, 
-                            uint16_t flags, void *private_data)
-{
-       struct ctdb_queue *queue = talloc_get_type(private_data, struct ctdb_queue);
-
-       if (flags & EVENT_FD_READ) {
-               queue_io_read(queue);
-       } else {
-               queue_io_write(queue);
-       }
-}
-
-
-/*
-  queue a packet for sending
-*/
-int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length)
-{
-       struct ctdb_queue_pkt *pkt;
-       uint32_t length2, full_length;
-
-       if (queue->alignment) {
-               /* enforce the length and alignment rules from the tcp packet allocator */
-               length2 = (length+(queue->alignment-1)) & ~(queue->alignment-1);
-               *(uint32_t *)data = length2;
-       } else {
-               length2 = length;
-       }
-
-       if (length2 != length) {
-               memset(data+length, 0, length2-length);
-       }
-
-       full_length = length2;
-       
-       /* if the queue is empty then try an immediate write, avoiding
-          queue overhead. This relies on non-blocking sockets */
-       if (queue->out_queue == NULL && queue->fd != -1 &&
-           !(queue->ctdb->flags & CTDB_FLAG_TORTURE)) {
-               ssize_t n = write(queue->fd, data, length2);
-               if (n == -1 && errno != EAGAIN && errno != EWOULDBLOCK) {
-                       talloc_free(queue->fde);
-                       queue->fde = NULL;
-                       queue->fd = -1;
-                       event_add_timed(queue->ctdb->ev, queue, timeval_zero(), 
-                                       queue_dead, queue);
-                       /* yes, we report success, as the dead node is 
-                          handled via a separate event */
-                       return 0;
-               }
-               if (n > 0) {
-                       data += n;
-                       length2 -= n;
-               }
-               if (length2 == 0) return 0;
-       }
-
-       pkt = talloc(queue, struct ctdb_queue_pkt);
-       CTDB_NO_MEMORY(queue->ctdb, pkt);
-
-       pkt->data = (uint8_t *)talloc_memdup(pkt, data, length2);
-       CTDB_NO_MEMORY(queue->ctdb, pkt->data);
-
-       pkt->length = length2;
-       pkt->full_length = full_length;
-
-       if (queue->out_queue == NULL && queue->fd != -1) {
-               EVENT_FD_WRITEABLE(queue->fde);
-       }
-
-       DLIST_ADD_END(queue->out_queue, pkt, struct ctdb_queue_pkt *);
-
-       return 0;
-}
-
-
-/*
-  setup the fd used by the queue
- */
-int ctdb_queue_set_fd(struct ctdb_queue *queue, int fd)
-{
-       queue->fd = fd;
-       talloc_free(queue->fde);
-       queue->fde = NULL;
-
-       if (fd != -1) {
-               queue->fde = event_add_fd(queue->ctdb->ev, queue, fd, EVENT_FD_READ|EVENT_FD_AUTOCLOSE, 
-                                         queue_io_handler, queue);
-               if (queue->fde == NULL) {
-                       return -1;
-               }
-
-               if (queue->out_queue) {
-                       EVENT_FD_WRITEABLE(queue->fde);         
-               }
-       }
-
-       return 0;
-}
-
-
-
-/*
-  setup a packet queue on a socket
- */
-struct ctdb_queue *ctdb_queue_setup(struct ctdb_context *ctdb,
-                                   TALLOC_CTX *mem_ctx, int fd, int alignment,
-                                   
-                                   ctdb_queue_cb_fn_t callback,
-                                   void *private_data)
-{
-       struct ctdb_queue *queue;
-
-       queue = talloc_zero(mem_ctx, struct ctdb_queue);
-       CTDB_NO_MEMORY_NULL(ctdb, queue);
-
-       queue->ctdb = ctdb;
-       queue->fd = fd;
-       queue->alignment = alignment;
-       queue->private_data = private_data;
-       queue->callback = callback;
-       if (fd != -1) {
-               if (ctdb_queue_set_fd(queue, fd) != 0) {
-                       talloc_free(queue);
-                       return NULL;
-               }
-       }
-
-       return queue;
-}
diff --git a/source4/cluster/ctdb/common/ctdb_ltdb.c b/source4/cluster/ctdb/common/ctdb_ltdb.c
deleted file mode 100644 (file)
index 1673368..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/* 
-   ctdb ltdb code
-
-   Copyright (C) Andrew Tridgell  2006
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "../tdb/include/tdb.h"
-#include "system/network.h"
-#include "system/filesys.h"
-#include "../include/ctdb_private.h"
-#include "tdb_wrap.h"
-#include "../lib/util/dlinklist.h"
-
-/*
-  find an attached ctdb_db handle given a name
- */
-struct ctdb_db_context *ctdb_db_handle(struct ctdb_context *ctdb, const char *name)
-{
-       struct ctdb_db_context *tmp_db;
-       for (tmp_db=ctdb->db_list;tmp_db;tmp_db=tmp_db->next) {
-               if (strcmp(name, tmp_db->db_name) == 0) {
-                       return tmp_db;
-               }
-       }
-       return NULL;
-}
-
-
-/*
-  return the lmaster given a key
-*/
-uint32_t ctdb_lmaster(struct ctdb_context *ctdb, const TDB_DATA *key)
-{
-       uint32_t idx, lmaster;
-
-       idx = ctdb_hash(key) % ctdb->vnn_map->size;
-       lmaster = ctdb->vnn_map->map[idx];
-
-       return lmaster;
-}
-
-
-/*
-  construct an initial header for a record with no ltdb header yet
-*/
-static void ltdb_initial_header(struct ctdb_db_context *ctdb_db, 
-                               TDB_DATA key,
-                               struct ctdb_ltdb_header *header)
-{
-       header->rsn = 0;
-       /* initial dmaster is the lmaster */
-       header->dmaster = ctdb_lmaster(ctdb_db->ctdb, &key);
-       header->laccessor = header->dmaster;
-       header->lacount = 0;
-}
-
-
-/*
-  fetch a record from the ltdb, separating out the header information
-  and returning the body of the record. A valid (initial) header is
-  returned if the record is not present
-*/
-int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db, 
-                   TDB_DATA key, struct ctdb_ltdb_header *header, 
-                   TALLOC_CTX *mem_ctx, TDB_DATA *data)
-{
-       TDB_DATA rec;
-       struct ctdb_context *ctdb = ctdb_db->ctdb;
-
-       rec = tdb_fetch(ctdb_db->ltdb->tdb, key);
-       if (rec.dsize < sizeof(*header)) {
-               TDB_DATA d2;
-               /* return an initial header */
-               if (rec.dptr) free(rec.dptr);
-               if (ctdb->vnn_map == NULL) {
-                       /* called from the client */
-                       ZERO_STRUCTP(data);
-                       header->dmaster = (uint32_t)-1;
-                       return -1;
-               }
-               ltdb_initial_header(ctdb_db, key, header);
-               ZERO_STRUCT(d2);
-               if (data) {
-                       *data = d2;
-               }
-               ctdb_ltdb_store(ctdb_db, key, header, d2);
-               return 0;
-       }
-
-       *header = *(struct ctdb_ltdb_header *)rec.dptr;
-
-       if (data) {
-               data->dsize = rec.dsize - sizeof(struct ctdb_ltdb_header);
-               data->dptr = (unsigned char *)talloc_memdup(mem_ctx, 
-                                          sizeof(struct ctdb_ltdb_header)+rec.dptr,
-                                          data->dsize);
-       }
-
-       free(rec.dptr);
-       if (data) {
-               CTDB_NO_MEMORY(ctdb, data->dptr);
-       }
-
-       return 0;
-}
-
-
-/*
-  fetch a record from the ltdb, separating out the header information
-  and returning the body of the record. A valid (initial) header is
-  returned if the record is not present
-*/
-int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key, 
-                   struct ctdb_ltdb_header *header, TDB_DATA data)
-{
-       struct ctdb_context *ctdb = ctdb_db->ctdb;
-       TDB_DATA rec;
-       int ret;
-
-       if (ctdb->flags & CTDB_FLAG_TORTURE) {
-               struct ctdb_ltdb_header *h2;
-               rec = tdb_fetch(ctdb_db->ltdb->tdb, key);
-               h2 = (struct ctdb_ltdb_header *)rec.dptr;
-               if (rec.dptr && rec.dsize >= sizeof(h2) && h2->rsn > header->rsn) {
-                       DEBUG(0,("RSN regression! %llu %llu\n",
-                                (unsigned long long)h2->rsn, (unsigned long long)header->rsn));
-               }
-               if (rec.dptr) free(rec.dptr);
-       }
-
-       rec.dsize = sizeof(*header) + data.dsize;
-       rec.dptr = (unsigned char *)talloc_size(ctdb, rec.dsize);
-       CTDB_NO_MEMORY(ctdb, rec.dptr);
-
-       memcpy(rec.dptr, header, sizeof(*header));
-       memcpy(rec.dptr + sizeof(*header), data.dptr, data.dsize);
-
-       ret = tdb_store(ctdb_db->ltdb->tdb, key, rec, TDB_REPLACE);
-       talloc_free(rec.dptr);
-
-       return ret;
-}
-
-
-/*
-  lock a record in the ltdb, given a key
- */
-int ctdb_ltdb_lock(struct ctdb_db_context *ctdb_db, TDB_DATA key)
-{
-       return tdb_chainlock(ctdb_db->ltdb->tdb, key);
-}
-
-/*
-  unlock a record in the ltdb, given a key
- */
-int ctdb_ltdb_unlock(struct ctdb_db_context *ctdb_db, TDB_DATA key)
-{
-       int ret = tdb_chainunlock(ctdb_db->ltdb->tdb, key);
-       if (ret != 0) {
-               DEBUG(0,("tdb_chainunlock failed\n"));
-       }
-       return ret;
-}
diff --git a/source4/cluster/ctdb/common/ctdb_message.c b/source4/cluster/ctdb/common/ctdb_message.c
deleted file mode 100644 (file)
index 54f8e2a..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/* 
-   ctdb_message protocol code
-
-   Copyright (C) Andrew Tridgell  2007
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-/*
-  see http://wiki.samba.org/index.php/Samba_%26_Clustering for
-  protocol design and packet details
-*/
-#include "includes.h"
-#include "../tdb/include/tdb.h"
-#include "system/network.h"
-#include "system/filesys.h"
-#include "../include/ctdb_private.h"
-#include "../lib/util/dlinklist.h"
-
-/*
-  this dispatches the messages to the registered ctdb message handler
-*/
-int ctdb_dispatch_message(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA data)
-{
-       struct ctdb_message_list *ml;
-
-       for (ml=ctdb->message_list;ml;ml=ml->next) {
-               if (ml->srvid == srvid || ml->srvid == CTDB_SRVID_ALL) {
-                       ml->message_handler(ctdb, srvid, data, ml->message_private);
-               }
-       }
-
-       return 0;
-}
-
-/*
-  called when a CTDB_REQ_MESSAGE packet comes in
-*/
-void ctdb_request_message(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
-{
-       struct ctdb_req_message *c = (struct ctdb_req_message *)hdr;
-       TDB_DATA data;
-
-       data.dptr = &c->data[0];
-       data.dsize = c->datalen;
-
-       ctdb_dispatch_message(ctdb, c->srvid, data);
-}
-
-
-/*
-  when a client goes away, we need to remove its srvid handler from the list
- */
-static int message_handler_destructor(struct ctdb_message_list *m)
-{
-       DLIST_REMOVE(m->ctdb->message_list, m);
-       return 0;
-}
-
-/*
-  setup handler for receipt of ctdb messages from ctdb_send_message()
-*/
-int ctdb_register_message_handler(struct ctdb_context *ctdb, 
-                                 TALLOC_CTX *mem_ctx,
-                                 uint64_t srvid,
-                                 ctdb_message_fn_t handler,
-                                 void *private_data)
-{
-       struct ctdb_message_list *m;
-
-       m = talloc(mem_ctx, struct ctdb_message_list);
-       CTDB_NO_MEMORY(ctdb, m);
-
-       m->ctdb            = ctdb;
-       m->srvid           = srvid;
-       m->message_handler = handler;
-       m->message_private = private_data;
-       
-       DLIST_ADD(ctdb->message_list, m);
-
-       talloc_set_destructor(m, message_handler_destructor);
-
-       return 0;
-}
-
-
-/*
-  setup handler for receipt of ctdb messages from ctdb_send_message()
-*/
-int ctdb_deregister_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void *private_data)
-{
-       struct ctdb_message_list *m;
-
-       for (m=ctdb->message_list;m;m=m->next) {
-               if (m->srvid == srvid && m->message_private == private_data) {
-                       talloc_free(m);
-                       return 0;
-               }
-       }
-       return -1;
-}
diff --git a/source4/cluster/ctdb/common/ctdb_util.c b/source4/cluster/ctdb/common/ctdb_util.c
deleted file mode 100644 (file)
index f6389c4..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-/* 
-   ctdb utility code
-
-   Copyright (C) Andrew Tridgell  2006
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "../tdb/include/tdb.h"
-#include "system/network.h"
-#include "system/filesys.h"
-#include "../include/ctdb_private.h"
-
-int LogLevel;
-
-/*
-  return error string for last error
-*/
-const char *ctdb_errstr(struct ctdb_context *ctdb)
-{
-       return ctdb->err_msg;
-}
-
-
-/*
-  remember an error message
-*/
-void ctdb_set_error(struct ctdb_context *ctdb, const char *fmt, ...)
-{
-       va_list ap;
-       talloc_free(ctdb->err_msg);
-       va_start(ap, fmt);
-       ctdb->err_msg = talloc_vasprintf(ctdb, fmt, ap);
-       DEBUG(0,("ctdb error: %s\n", ctdb->err_msg));
-       va_end(ap);
-}
-
-/*
-  a fatal internal error occurred - no hope for recovery
-*/
-_NORETURN_ void ctdb_fatal(struct ctdb_context *ctdb, const char *msg)
-{
-       DEBUG(0,("ctdb fatal error: %s\n", msg));
-       abort();
-}
-
-/*
-  parse a IP:port pair
-*/
-int ctdb_parse_address(struct ctdb_context *ctdb,
-                      TALLOC_CTX *mem_ctx, const char *str,
-                      struct ctdb_address *address)
-{
-       struct servent *se;
-
-       setservent(0);
-       se = getservbyname("ctdb", "tcp");
-       endservent();
-       
-       address->address = talloc_strdup(mem_ctx, str);
-       if (se == NULL) {
-               address->port = CTDB_PORT;
-       } else {
-               address->port = ntohs(se->s_port);
-       }
-       return 0;
-}
-
-
-/*
-  check if two addresses are the same
-*/
-bool ctdb_same_address(struct ctdb_address *a1, struct ctdb_address *a2)
-{
-       return strcmp(a1->address, a2->address) == 0 && a1->port == a2->port;
-}
-
-
-/*
-  hash function for mapping data to a VNN - taken from tdb
-*/
-uint32_t ctdb_hash(const TDB_DATA *key)
-{
-       uint32_t value; /* Used to compute the hash value.  */
-       uint32_t i;     /* Used to cycle through random values. */
-
-       /* Set the initial value from the key size. */
-       for (value = 0x238F13AF * key->dsize, i=0; i < key->dsize; i++)
-               value = (value + (key->dptr[i] << (i*5 % 24)));
-
-       return (1103515243 * value + 12345);  
-}
-
-/*
-  a type checking varient of idr_find
- */
-static void *_idr_find_type(struct idr_context *idp, int id, const char *type, const char *location)
-{
-       void *p = idr_find(idp, id);
-       if (p && talloc_check_name(p, type) == NULL) {
-               DEBUG(0,("%s idr_find_type expected type %s  but got %s\n",
-                        location, type, talloc_get_name(p)));
-               return NULL;
-       }
-       return p;
-}
-
-
-/*
-  update a max latency number
- */
-void ctdb_latency(double *latency, struct timeval t)
-{
-       double l = timeval_elapsed(&t);
-       if (l > *latency) {
-               *latency = l;
-       }
-}
-
-uint32_t ctdb_reqid_new(struct ctdb_context *ctdb, void *state)
-{
-       uint32_t id;
-
-       id  = ctdb->idr_cnt++ & 0xFFFF;
-       id |= (idr_get_new(ctdb->idr, state, 0xFFFF)<<16);
-       return id;
-}
-
-void *_ctdb_reqid_find(struct ctdb_context *ctdb, uint32_t reqid, const char *type, const char *location)
-{
-       void *p;
-
-       p = _idr_find_type(ctdb->idr, (reqid>>16)&0xFFFF, type, location);
-       if (p == NULL) {
-               DEBUG(0, ("Could not find idr:%u\n",reqid));
-       }
-
-       return p;
-}
-
-
-void ctdb_reqid_remove(struct ctdb_context *ctdb, uint32_t reqid)
-{
-       int ret;
-
-       ret = idr_remove(ctdb->idr, (reqid>>16)&0xFFFF);
-       if (ret != 0) {
-               DEBUG(0, ("Removing idr that does not exist\n"));
-       }
-}
-
-
-/*
-  form a ctdb_rec_data record from a key/data pair
- */
-struct ctdb_rec_data *ctdb_marshall_record(TALLOC_CTX *mem_ctx, uint32_t reqid,        TDB_DATA key, TDB_DATA data)
-{
-       size_t length;
-       struct ctdb_rec_data *d;
-
-       length = offsetof(struct ctdb_rec_data, data) + key.dsize + data.dsize;
-       d = (struct ctdb_rec_data *)talloc_size(mem_ctx, length);
-       if (d == NULL) {
-               return NULL;
-       }
-       d->length = length;
-       d->reqid = reqid;
-       d->keylen = key.dsize;
-       d->datalen = data.dsize;
-       memcpy(&d->data[0], key.dptr, key.dsize);
-       memcpy(&d->data[key.dsize], data.dptr, data.dsize);
-       return d;
-}
-
-#if HAVE_SCHED_H
-#include <sched.h>
-#endif
-
-/*
-  if possible, make this task real time
- */
-void ctdb_set_scheduler(struct ctdb_context *ctdb)
-{
-#if HAVE_SCHED_SETSCHEDULER    
-       struct sched_param p;
-       if (ctdb->saved_scheduler_param == NULL) {
-               ctdb->saved_scheduler_param = talloc_size(ctdb, sizeof(p));
-       }
-       
-       if (sched_getparam(0, (struct sched_param *)ctdb->saved_scheduler_param) == -1) {
-               DEBUG(0,("Unable to get old scheduler params\n"));
-               return;
-       }
-
-       p = *(struct sched_param *)ctdb->saved_scheduler_param;
-       p.sched_priority = 1;
-
-       if (sched_setscheduler(0, SCHED_FIFO, &p) == -1) {
-               DEBUG(0,("Unable to set scheduler to SCHED_FIFO (%s)\n", 
-                        strerror(errno)));
-       } else {
-               DEBUG(0,("Set scheduler to SCHED_FIFO\n"));
-       }
-#endif
-}
-
-/*
-  restore previous scheduler parameters
- */
-void ctdb_restore_scheduler(struct ctdb_context *ctdb)
-{
-#if HAVE_SCHED_SETSCHEDULER    
-       if (ctdb->saved_scheduler_param == NULL) {
-               ctdb_fatal(ctdb, "No saved scheduler parameters\n");
-       }
-       if (sched_setscheduler(0, SCHED_OTHER, (struct sched_param *)ctdb->saved_scheduler_param) == -1) {
-               ctdb_fatal(ctdb, "Unable to restore old scheduler parameters\n");
-       }
-#endif
-}
-
-void set_nonblocking(int fd)
-{
-       unsigned v;
-       v = fcntl(fd, F_GETFL, 0);
-        fcntl(fd, F_SETFL, v | O_NONBLOCK);
-}
-
-void set_close_on_exec(int fd)
-{
-       unsigned v;
-       v = fcntl(fd, F_GETFD, 0);
-        fcntl(fd, F_SETFD, v | FD_CLOEXEC);
-}
-
-
-/*
-  parse a ip:port pair
- */
-bool parse_ip_port(const char *s, struct sockaddr_in *ip)
-{
-       const char *p;
-       char *endp = NULL;
-       unsigned port;
-       char buf[16];
-
-       ip->sin_family = AF_INET;
-
-       p = strchr(s, ':');
-       if (p == NULL) {
-               return false;
-       }
-
-       if (p - s > 15) {
-               return false;
-       }
-
-       port = strtoul(p+1, &endp, 10);
-       if (endp == NULL || *endp != 0) {
-               /* trailing garbage */
-               return false;
-       }
-       ip->sin_port = htons(port);
-
-       strlcpy(buf, s, 1+p-s);
-
-       if (inet_aton(buf, &ip->sin_addr) == 0) {
-               return false;
-       }
-
-       return true;
-}
diff --git a/source4/cluster/ctdb/common/system.c b/source4/cluster/ctdb/common/system.c
deleted file mode 100644 (file)
index 1e536f5..0000000
+++ /dev/null
@@ -1,385 +0,0 @@
-/* 
-   ctdb recovery code
-
-   Copyright (C) Ronnie Sahlberg  2007
-   Copyright (C) Andrew Tridgell  2007
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "system/network.h"
-#include "system/filesys.h"
-#include "system/wait.h"
-#include "../include/ctdb_private.h"
-#include "lib/events/events.h"
-#include <net/ethernet.h>
-#include <net/if_arp.h>
-
-
-
-/*
-  send gratuitous arp reply after we have taken over an ip address
-
-  saddr is the address we are trying to claim
-  iface is the interface name we will be using to claim the address
- */
-int ctdb_sys_send_arp(const struct sockaddr_in *saddr, const char *iface)
-{
-       int s, ret;
-       struct sockaddr sa;
-       struct ether_header *eh;
-       struct arphdr *ah;
-       struct ifreq if_hwaddr;
-       unsigned char buffer[64]; /*minimum eth frame size */
-       char *ptr;
-
-       /* for now, we only handle AF_INET addresses */
-       if (saddr->sin_family != AF_INET) {
-               DEBUG(0,(__location__ " not an ipv4 address (family is %u)\n", saddr->sin_family));
-               return -1;
-       }
-
-       s = socket(AF_INET, SOCK_PACKET, htons(ETHERTYPE_ARP));
-       if (s == -1){
-               DEBUG(0,(__location__ " failed to open raw socket\n"));
-               return -1;
-       }
-
-       /* get the mac address */
-       strcpy(if_hwaddr.ifr_name, iface);
-       ret = ioctl(s, SIOCGIFHWADDR, &if_hwaddr);
-       if ( ret < 0 ) {
-               close(s);
-               DEBUG(0,(__location__ " ioctl failed\n"));
-               return -1;
-       }
-       if (ARPHRD_LOOPBACK == if_hwaddr.ifr_hwaddr.sa_family) {
-               DEBUG(3,("Ignoring loopback arp request\n"));
-               close(s);
-               return 0;
-       }
-       if (if_hwaddr.ifr_hwaddr.sa_family != AF_LOCAL) {
-               close(s);
-               errno = EINVAL;
-               DEBUG(0,(__location__ " not an ethernet address family (0x%x)\n",
-                        if_hwaddr.ifr_hwaddr.sa_family));
-               return -1;
-       }
-
-
-       memset(buffer, 0 , 64);
-       eh = (struct ether_header *)buffer;
-       memset(eh->ether_dhost, 0xff, ETH_ALEN);
-       memcpy(eh->ether_shost, if_hwaddr.ifr_hwaddr.sa_data, ETH_ALEN);
-       eh->ether_type = htons(ETHERTYPE_ARP);
-
-       ah = (struct arphdr *)&buffer[sizeof(struct ether_header)];
-       ah->ar_hrd = htons(ARPHRD_ETHER);
-       ah->ar_pro = htons(ETH_P_IP);
-       ah->ar_hln = ETH_ALEN;
-       ah->ar_pln = 4;
-
-       /* send a gratious arp */
-       ah->ar_op  = htons(ARPOP_REQUEST);
-       ptr = (char *)&ah[1];
-       memcpy(ptr, if_hwaddr.ifr_hwaddr.sa_data, ETH_ALEN);
-       ptr+=ETH_ALEN;
-       memcpy(ptr, &saddr->sin_addr, 4);         
-       ptr+=4;
-       memset(ptr, 0, ETH_ALEN); 
-       ptr+=ETH_ALEN;
-       memcpy(ptr, &saddr->sin_addr, 4);         
-       ptr+=4;
-
-       strncpy(sa.sa_data, iface, sizeof(sa.sa_data));
-       ret = sendto(s, buffer, 64, 0, &sa, sizeof(sa));
-       if (ret < 0 ){
-               close(s);
-               DEBUG(0,(__location__ " failed sendto\n"));
-               return -1;
-       }
-
-       /* send unsolicited arp reply broadcast */
-       ah->ar_op  = htons(ARPOP_REPLY);
-       ptr = (char *)&ah[1];
-       memcpy(ptr, if_hwaddr.ifr_hwaddr.sa_data, ETH_ALEN);
-       ptr+=ETH_ALEN;
-       memcpy(ptr, &saddr->sin_addr, 4);         
-       ptr+=4;
-       memcpy(ptr, if_hwaddr.ifr_hwaddr.sa_data, ETH_ALEN);
-       ptr+=ETH_ALEN;
-       memcpy(ptr, &saddr->sin_addr, 4);         
-       ptr+=4;
-
-       strncpy(sa.sa_data, iface, sizeof(sa.sa_data));
-       ret = sendto(s, buffer, 64, 0, &sa, sizeof(sa));
-       if (ret < 0 ){
-               DEBUG(0,(__location__ " failed sendto\n"));
-               return -1;
-       }
-
-       close(s);
-       return 0;
-}
-
-
-/*
-  uint16 checksum for n bytes
- */
-static uint32_t uint16_checksum(uint16_t *data, size_t n)
-{
-       uint32_t sum=0;
-       while (n>=2) {
-               sum += (uint32_t)ntohs(*data);
-               data++;
-               n -= 2;
-       }
-       if (n == 1) {
-               sum += (uint32_t)ntohs(*(uint8_t *)data);
-       }
-       return sum;
-}
-
-/*
-  simple TCP checksum - assumes data is multiple of 2 bytes long
- */
-static uint16_t tcp_checksum(uint16_t *data, size_t n, struct iphdr *ip)
-{
-       uint32_t sum = uint16_checksum(data, n);
-       uint16_t sum2;
-       sum += uint16_checksum((uint16_t *)&ip->saddr, sizeof(ip->saddr));
-       sum += uint16_checksum((uint16_t *)&ip->daddr, sizeof(ip->daddr));
-       sum += ip->protocol + n;
-       sum = (sum & 0xFFFF) + (sum >> 16);
-       sum = (sum & 0xFFFF) + (sum >> 16);
-       sum2 = htons(sum);
-       sum2 = ~sum2;
-       if (sum2 == 0) {
-               return 0xFFFF;
-       }
-       return sum2;
-}
-
-/*
-  Send tcp segment from the specified IP/port to the specified
-  destination IP/port. 
-
-  This is used to trigger the receiving host into sending its own ACK,
-  which should trigger early detection of TCP reset by the client
-  after IP takeover
-
-  This can also be used to send RST segments (if rst is true) and also
-  if correct seq and ack numbers are provided.
- */
-int ctdb_sys_send_tcp(const struct sockaddr_in *dest, 
-                     const struct sockaddr_in *src,
-                     uint32_t seq, uint32_t ack, int rst)
-{
-       int s, ret;
-       uint32_t one = 1;
-       struct {
-               struct iphdr ip;
-               struct tcphdr tcp;
-       } pkt;
-
-       /* for now, we only handle AF_INET addresses */
-       if (src->sin_family != AF_INET || dest->sin_family != AF_INET) {
-               DEBUG(0,(__location__ " not an ipv4 address\n"));
-               return -1;
-       }
-
-       s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
-       if (s == -1) {
-               DEBUG(0,(__location__ " failed to open raw socket (%s)\n",
-                        strerror(errno)));
-               return -1;
-       }
-
-       ret = setsockopt(s, SOL_IP, IP_HDRINCL, &one, sizeof(one));
-       if (ret != 0) {
-               DEBUG(0,(__location__ " failed to setup IP headers (%s)\n",
-                        strerror(errno)));
-               close(s);
-               return -1;
-       }
-
-       ZERO_STRUCT(pkt);
-       pkt.ip.version  = 4;
-       pkt.ip.ihl      = sizeof(pkt.ip)/4;
-       pkt.ip.tot_len  = htons(sizeof(pkt));
-       pkt.ip.ttl      = 255;
-       pkt.ip.protocol = IPPROTO_TCP;
-       pkt.ip.saddr    = src->sin_addr.s_addr;
-       pkt.ip.daddr    = dest->sin_addr.s_addr;
-       pkt.ip.check    = 0;
-
-       pkt.tcp.source   = src->sin_port;
-       pkt.tcp.dest     = dest->sin_port;
-       pkt.tcp.seq      = seq;
-       pkt.tcp.ack_seq  = ack;
-       pkt.tcp.ack      = 1;
-       if (rst) {
-               pkt.tcp.rst      = 1;
-       }
-       pkt.tcp.doff     = sizeof(pkt.tcp)/4;
-       pkt.tcp.window   = htons(1234);
-       pkt.tcp.check    = tcp_checksum((uint16_t *)&pkt.tcp, sizeof(pkt.tcp), &pkt.ip);
-
-       ret = sendto(s, &pkt, sizeof(pkt), 0, dest, sizeof(*dest));
-       if (ret != sizeof(pkt)) {
-               DEBUG(0,(__location__ " failed sendto (%s)\n", strerror(errno)));
-               close(s);
-               return -1;
-       }
-
-       close(s);
-       return 0;
-}
-
-
-/*
-  see if we currently have an interface with the given IP
-
-  we try to bind to it, and if that fails then we don't have that IP
-  on an interface
- */
-bool ctdb_sys_have_ip(const char *ip)
-{
-       struct sockaddr_in sin;
-       int s;
-       int ret;
-
-       sin.sin_port = 0;
-       inet_aton(ip, &sin.sin_addr);
-       sin.sin_family = AF_INET;
-       s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
-       if (s == -1) {
-               return false;
-       }
-       ret = bind(s, (struct sockaddr *)&sin, sizeof(sin));
-       close(s);
-       return ret == 0;
-}
-
-static void ctdb_wait_handler(struct event_context *ev, struct timed_event *te, 
-                             struct timeval yt, void *p)
-{
-       uint32_t *timed_out = (uint32_t *)p;
-       (*timed_out) = 1;
-}
-
-/* This function is used to kill (RST) the specified tcp connection.
-
-   This function is not asynchronous and will block until the operation
-   was successful or it timesout.
- */
-int ctdb_sys_kill_tcp(struct event_context *ev,
-                     const struct sockaddr_in *dst, 
-                     const struct sockaddr_in *src)
-{
-       int s, ret;
-       uint32_t timedout;
-       TALLOC_CTX *tmp_ctx = talloc_new(NULL);
-#define RCVPKTSIZE 100
-       char pkt[RCVPKTSIZE];
-       struct ether_header *eth;
-       struct iphdr *ip;
-       struct tcphdr *tcp;
-
-       /* Open a socket to capture all traffic */
-       s=socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
-       if (s == -1){
-               DEBUG(0,(__location__ " failed to open raw socket\n"));
-               return -1;
-       }
-
-       /* We wait for up to 1 second for the ACK coming back */
-       timedout = 0;
-       event_add_timed(ev, tmp_ctx, timeval_current_ofs(1, 0), ctdb_wait_handler, &timedout);
-
-       /* Send a tickle ack to probe what the real seq/ack numbers are */
-       ctdb_sys_send_tcp(dst, src, 0, 0, 0);
-
-       /* Wait until we either time out or we succeeds in sending the RST */
-       while (timedout==0) {
-               event_loop_once(ev);
-
-               ret = recv(s, pkt, RCVPKTSIZE, MSG_TRUNC);
-               if (ret < sizeof(*eth)+sizeof(*ip)) {
-                       continue;
-               }
-
-               /* Ethernet */
-               eth = (struct ether_header *)pkt;
-               /* We only want IP packets */
-               if (ntohs(eth->ether_type) != ETHERTYPE_IP) {
-                       continue;
-               }
-       
-               /* IP */
-               ip = (struct iphdr *)(eth+1);
-               /* We only want IPv4 packets */
-               if (ip->version != 4) {
-                       continue;
-               }
-               /* Dont look at fragments */
-               if ((ntohs(ip->frag_off)&0x1fff) != 0) {
-                       continue;
-               }
-               /* we only want TCP */
-               if (ip->protocol != IPPROTO_TCP) {
-                       continue;
-               }
-
-               /* We only want packets sent from the guy we tickled */
-               if (ip->saddr != dst->sin_addr.s_addr) {
-                       continue;
-               }
-               /* We only want packets sent to us */
-               if (ip->daddr != src->sin_addr.s_addr) {
-                       continue;
-               }
-
-               /* make sure its not a short packet */
-               if (offsetof(struct tcphdr, ack_seq) + 4 + 
-                   (ip->ihl*4) + sizeof(*eth) > ret) {
-                       continue;
-               }
-
-               /* TCP */
-               tcp = (struct tcphdr *)((ip->ihl*4) + (char *)ip);
-               
-               /* We only want replies from the port we tickled */
-               if (tcp->source != dst->sin_port) {
-                       continue;
-               }
-               if (tcp->dest != src->sin_port) {
-                       continue;
-               }
-
-               ctdb_sys_send_tcp(dst, src, tcp->ack_seq, tcp->seq, 1);
-
-               close(s);
-               talloc_free(tmp_ctx);
-
-               return 0;
-       }
-
-       close(s);
-       talloc_free(tmp_ctx);
-       DEBUG(0,(__location__ " timedout waiting for tickle ack reply\n"));
-
-       return -1;
-}
diff --git a/source4/cluster/ctdb/config.guess b/source4/cluster/ctdb/config.guess
deleted file mode 100755 (executable)
index 386626b..0000000
+++ /dev/null
@@ -1,1464 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
-timestamp='2007-07-10'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )        # Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help" >&2
-       exit 1 ;;
-    * )
-       break ;;
-  esac
-done
-
-if test $# != 0; then
-  echo "$me: too many arguments$help" >&2
-  exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-       for c in cc gcc c89 c99 ; do
-         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-            CC_FOR_BUILD="$c"; break ;
-         fi ;
-       done ;
-       if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found ;
-       fi
-       ;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
-       PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
-    *:NetBSD:*:*)
-       # NetBSD (nbsd) targets should (where applicable) match one or
-       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
-       # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
-       # switched to ELF, *-*-netbsd* would select the old
-       # object file format.  This provides both forward
-       # compatibility and a consistent mechanism for selecting the
-       # object file format.
-       #
-       # Note: NetBSD doesn't particularly care about the vendor
-       # portion of the name.  We always set it to "unknown".
-       sysctl="sysctl -n hw.machine_arch"
-       UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-           /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
-       case "${UNAME_MACHINE_ARCH}" in
-           armeb) machine=armeb-unknown ;;
-           arm*) machine=arm-unknown ;;
-           sh3el) machine=shl-unknown ;;
-           sh3eb) machine=sh-unknown ;;
-           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
-       esac
-       # The Operating System including object format, if it has switched
-       # to ELF recently, or will in the future.
-       case "${UNAME_MACHINE_ARCH}" in
-           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval $set_cc_for_build
-               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-                       | grep __ELF__ >/dev/null
-               then
-                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
-                   # Return netbsd for either.  FIX?
-                   os=netbsd
-               else
-                   os=netbsdelf
-               fi
-               ;;
-           *)
-               os=netbsd
-               ;;
-       esac
-       # The OS release
-       # Debian GNU/NetBSD machines have a different userland, and
-       # thus, need a distinct triplet. However, they do not need
-       # kernel version information, so it can be replaced with a
-       # suitable tag, in the style of linux-gnu.
-       case "${UNAME_VERSION}" in
-           Debian*)
-               release='-gnu'
-               ;;
-           *)
-               release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-               ;;
-       esac
-       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
-       # contains redundant information, the shorter form:
-       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-       echo "${machine}-${os}${release}"
-       exit ;;
-    *:OpenBSD:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
-    *:ekkoBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-       exit ;;
-    macppc:MirBSD:*:*)
-       echo powerppc-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
-    *:MirBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
-    alpha:OSF1:*:*)
-       case $UNAME_RELEASE in
-       *4.0)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-               ;;
-       *5.*)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
-               ;;
-       esac
-       # According to Compaq, /usr/sbin/psrinfo has been available on
-       # OSF/1 and Tru64 systems produced since 1995.  I hope that
-       # covers most systems running today.  This code pipes the CPU
-       # types through head -n 1, so we only detect the type of CPU 0.
-       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-       case "$ALPHA_CPU_TYPE" in
-           "EV4 (21064)")
-               UNAME_MACHINE="alpha" ;;
-           "EV4.5 (21064)")
-               UNAME_MACHINE="alpha" ;;
-           "LCA4 (21066/21068)")
-               UNAME_MACHINE="alpha" ;;
-           "EV5 (21164)")
-               UNAME_MACHINE="alphaev5" ;;
-           "EV5.6 (21164A)")
-               UNAME_MACHINE="alphaev56" ;;
-           "EV5.6 (21164PC)")
-               UNAME_MACHINE="alphapca56" ;;
-           "EV5.7 (21164PC)")
-               UNAME_MACHINE="alphapca57" ;;
-           "EV6 (21264)")
-               UNAME_MACHINE="alphaev6" ;;
-           "EV6.7 (21264A)")
-               UNAME_MACHINE="alphaev67" ;;
-           "EV6.8CB (21264C)")
-               UNAME_MACHINE="alphaev68" ;;
-           "EV6.8AL (21264B)")
-               UNAME_MACHINE="alphaev68" ;;
-           "EV6.8CX (21264D)")
-               UNAME_MACHINE="alphaev68" ;;
-           "EV6.9A (21264/EV69A)")
-               UNAME_MACHINE="alphaev69" ;;
-           "EV7 (21364)")
-               UNAME_MACHINE="alphaev7" ;;
-           "EV7.9 (21364A)")
-               UNAME_MACHINE="alphaev79" ;;
-       esac
-       # A Pn.n version is a patched version.
-       # A Vn.n version is a released version.
-       # A Tn.n version is a released field test version.
-       # A Xn.n version is an unreleased experimental baselevel.
-       # 1.2 uses "1.2" for uname -r.
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit ;;
-    Alpha\ *:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # Should we change UNAME_MACHINE based on the output of uname instead
-       # of the specific Alpha model?
-       echo alpha-pc-interix
-       exit ;;
-    21064:Windows_NT:50:3)
-       echo alpha-dec-winnt3.5
-       exit ;;
-    Amiga*:UNIX_System_V:4.0:*)
-       echo m68k-unknown-sysv4
-       exit ;;
-    *:[Aa]miga[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-amigaos
-       exit ;;
-    *:[Mm]orph[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-morphos
-       exit ;;
-    *:OS/390:*:*)
-       echo i370-ibm-openedition
-       exit ;;
-    *:z/VM:*:*)
-       echo s390-ibm-zvmoe
-       exit ;;
-    *:OS400:*:*)
-        echo powerpc-ibm-os400
-       exit ;;
-    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-       echo arm-acorn-riscix${UNAME_RELEASE}
-       exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
-       echo arm-unknown-riscos
-       exit ;;
-    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-       echo hppa1.1-hitachi-hiuxmpp
-       exit ;;
-    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
-       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-       if test "`(/bin/universe) 2>/dev/null`" = att ; then
-               echo pyramid-pyramid-sysv3
-       else
-               echo pyramid-pyramid-bsd
-       fi
-       exit ;;
-    NILE*:*:*:dcosx)
-       echo pyramid-pyramid-svr4
-       exit ;;
-    DRS?6000:unix:4.0:6*)
-       echo sparc-icl-nx6
-       exit ;;
-    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
-       case `/usr/bin/uname -p` in
-           sparc) echo sparc-icl-nx7; exit ;;
-       esac ;;
-    sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    i86pc:SunOS:5.*:*)
-       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    sun4*:SunOS:6*:*)
-       # According to config.sub, this is the proper way to canonicalize
-       # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
-       # it's likely to be more like Solaris than SunOS4.
-       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    sun4*:SunOS:*:*)
-       case "`/usr/bin/arch -k`" in
-           Series*|S4*)
-               UNAME_RELEASE=`uname -v`
-               ;;
-       esac
-       # Japanese Language versions have a version number like `4.1.3-JL'.
-       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-       exit ;;
-    sun3*:SunOS:*:*)
-       echo m68k-sun-sunos${UNAME_RELEASE}
-       exit ;;
-    sun*:*:4.2BSD:*)
-       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-       test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
-       case "`/bin/arch`" in
-           sun3)
-               echo m68k-sun-sunos${UNAME_RELEASE}
-               ;;
-           sun4)
-               echo sparc-sun-sunos${UNAME_RELEASE}
-               ;;
-       esac
-       exit ;;
-    aushp:SunOS:*:*)
-       echo sparc-auspex-sunos${UNAME_RELEASE}
-       exit ;;
-    # The situation for MiNT is a little confusing.  The machine name
-    # can be virtually everything (everything which is not
-    # "atarist" or "atariste" at least should have a processor
-    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
-    # to the lowercase version "mint" (or "freemint").  Finally
-    # the system name "TOS" denotes a system which is actually not
-    # MiNT.  But MiNT is downward compatible to TOS, so this should
-    # be no problem.
-    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
-    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
-    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
-    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
-    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
-    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
-    m68k:machten:*:*)
-       echo m68k-apple-machten${UNAME_RELEASE}
-       exit ;;
-    powerpc:machten:*:*)
-       echo powerpc-apple-machten${UNAME_RELEASE}
-       exit ;;
-    RISC*:Mach:*:*)
-       echo mips-dec-mach_bsd4.3
-       exit ;;
-    RISC*:ULTRIX:*:*)
-       echo mips-dec-ultrix${UNAME_RELEASE}
-       exit ;;
-    VAX*:ULTRIX*:*:*)
-       echo vax-dec-ultrix${UNAME_RELEASE}
-       exit ;;
-    2020:CLIX:*:* | 2430:CLIX:*:*)
-       echo clipper-intergraph-clix${UNAME_RELEASE}
-       exit ;;
-    mips:*:*:UMIPS | mips:*:*:RISCos)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-       int main (int argc, char *argv[]) {
-#else
-       int main (argc, argv) int argc; char *argv[]; {
-#endif
-       #if defined (host_mips) && defined (MIPSEB)
-       #if defined (SYSTYPE_SYSV)
-         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
-       #endif
-       #if defined (SYSTYPE_SVR4)
-         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
-       #endif
-       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
-       #endif
-       #endif
-         exit (-1);
-       }
-EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c &&
-         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-         SYSTEM_NAME=`$dummy $dummyarg` &&
-           { echo "$SYSTEM_NAME"; exit; }
-       echo mips-mips-riscos${UNAME_RELEASE}
-       exit ;;
-    Motorola:PowerMAX_OS:*:*)
-       echo powerpc-motorola-powermax
-       exit ;;
-    Motorola:*:4.3:PL8-*)
-       echo powerpc-harris-powermax
-       exit ;;
-    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
-       echo powerpc-harris-powermax
-       exit ;;
-    Night_Hawk:Power_UNIX:*:*)
-       echo powerpc-harris-powerunix
-       exit ;;
-    m88k:CX/UX:7*:*)
-       echo m88k-harris-cxux7
-       exit ;;
-    m88k:*:4*:R4*)
-       echo m88k-motorola-sysv4
-       exit ;;
-    m88k:*:3*:R3*)
-       echo m88k-motorola-sysv3
-       exit ;;
-    AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
-       then
-           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-              [ ${TARGET_BINARY_INTERFACE}x = x ]
-           then
-               echo m88k-dg-dgux${UNAME_RELEASE}
-           else
-               echo m88k-dg-dguxbcs${UNAME_RELEASE}
-           fi
-       else
-           echo i586-dg-dgux${UNAME_RELEASE}
-       fi
-       exit ;;
-    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
-       echo m88k-dolphin-sysv3
-       exit ;;
-    M88*:*:R3*:*)
-       # Delta 88k system running SVR3
-       echo m88k-motorola-sysv3
-       exit ;;
-    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
-       echo m88k-tektronix-sysv3
-       exit ;;
-    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
-       echo m68k-tektronix-bsd
-       exit ;;
-    *:IRIX*:*:*)
-       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-       exit ;;
-    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
-    i*86:AIX:*:*)
-       echo i386-ibm-aix
-       exit ;;
-    ia64:AIX:*:*)
-       if [ -x /usr/bin/oslevel ] ; then
-               IBM_REV=`/usr/bin/oslevel`
-       else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-       fi
-       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-       exit ;;
-    *:AIX:2:3)
-       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               eval $set_cc_for_build
-               sed 's/^                //' << EOF >$dummy.c
-               #include <sys/systemcfg.h>
-
-               main()
-                       {
-                       if (!__power_pc())
-                               exit(1);
-                       puts("powerpc-ibm-aix3.2.5");
-                       exit(0);
-                       }
-EOF
-               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
-               then
-                       echo "$SYSTEM_NAME"
-               else
-                       echo rs6000-ibm-aix3.2.5
-               fi
-       elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
-               echo rs6000-ibm-aix3.2.4
-       else
-               echo rs6000-ibm-aix3.2
-       fi
-       exit ;;
-    *:AIX:*:[45])
-       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
-               IBM_ARCH=rs6000
-       else
-               IBM_ARCH=powerpc
-       fi
-       if [ -x /usr/bin/oslevel ] ; then
-               IBM_REV=`/usr/bin/oslevel`
-       else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-       fi
-       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-       exit ;;
-    *:AIX:*:*)
-       echo rs6000-ibm-aix
-       exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
-       echo romp-ibm-bsd4.4
-       exit ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-       exit ;;                             # report: romp-ibm BSD 4.3
-    *:BOSX:*:*)
-       echo rs6000-bull-bosx
-       exit ;;
-    DPX/2?00:B.O.S.:*:*)
-       echo m68k-bull-sysv3
-       exit ;;
-    9000/[34]??:4.3bsd:1.*:*)
-       echo m68k-hp-bsd
-       exit ;;
-    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
-       echo m68k-hp-bsd4.4
-       exit ;;
-    9000/[34678]??:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       case "${UNAME_MACHINE}" in
-           9000/31? )            HP_ARCH=m68000 ;;
-           9000/[34]?? )         HP_ARCH=m68k ;;
-           9000/[678][0-9][0-9])
-               if [ -x /usr/bin/getconf ]; then
-                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
-                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
-               fi
-               if [ "${HP_ARCH}" = "" ]; then
-                   eval $set_cc_for_build
-                   sed 's/^              //' << EOF >$dummy.c
-
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
-
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
-
-                  switch (cpu)
-               {
-               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-                   switch (bits)
-                       {
-                       case 64: puts ("hppa2.0w"); break;
-                       case 32: puts ("hppa2.0n"); break;
-                       default: puts ("hppa2.0"); break;
-                       } break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-                   puts ("hppa2.0"); break;
-              #endif
-               default: puts ("hppa1.0"); break;
-               }
-                  exit (0);
-              }
-EOF
-                   (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
-                   test -z "$HP_ARCH" && HP_ARCH=hppa
-               fi ;;
-       esac
-       if [ ${HP_ARCH} = "hppa2.0w" ]
-       then
-           eval $set_cc_for_build
-
-           # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
-           # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
-           # generating 64-bit code.  GNU and HP use different nomenclature:
-           #
-           # $ CC_FOR_BUILD=cc ./config.guess
-           # => hppa2.0w-hp-hpux11.23
-           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
-           # => hppa64-hp-hpux11.23
-
-           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-               grep __LP64__ >/dev/null
-           then
-               HP_ARCH="hppa2.0w"
-           else
-               HP_ARCH="hppa64"
-           fi
-       fi
-       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-       exit ;;
-    ia64:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       echo ia64-hp-hpux${HPUX_REV}
-       exit ;;
-    3050*:HI-UX:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <unistd.h>
-       int
-       main ()
-       {
-         long cpu = sysconf (_SC_CPU_VERSION);
-         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
-            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
-            results, however.  */
-         if (CPU_IS_PA_RISC (cpu))
-           {
-             switch (cpu)
-               {
-                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
-                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
-                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
-                 default: puts ("hppa-hitachi-hiuxwe2"); break;
-               }
-           }
-         else if (CPU_IS_HP_MC68K (cpu))
-           puts ("m68k-hitachi-hiuxwe2");
-         else puts ("unknown-hitachi-hiuxwe2");
-         exit (0);
-       }
-EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
-               { echo "$SYSTEM_NAME"; exit; }
-       echo unknown-hitachi-hiuxwe2
-       exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
-       echo hppa1.1-hp-bsd
-       exit ;;
-    9000/8??:4.3bsd:*:*)
-       echo hppa1.0-hp-bsd
-       exit ;;
-    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
-       echo hppa1.0-hp-mpeix
-       exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
-       echo hppa1.1-hp-osf
-       exit ;;
-    hp8??:OSF1:*:*)
-       echo hppa1.0-hp-osf
-       exit ;;
-    i*86:OSF1:*:*)
-       if [ -x /usr/sbin/sysversion ] ; then
-           echo ${UNAME_MACHINE}-unknown-osf1mk
-       else
-           echo ${UNAME_MACHINE}-unknown-osf1
-       fi
-       exit ;;
-    parisc*:Lites*:*:*)
-       echo hppa1.1-hp-lites
-       exit ;;
-    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
-       echo c1-convex-bsd
-        exit ;;
-    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
-       if getsysinfo -f scalar_acc
-       then echo c32-convex-bsd
-       else echo c2-convex-bsd
-       fi
-        exit ;;
-    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
-       echo c34-convex-bsd
-        exit ;;
-    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
-       echo c38-convex-bsd
-        exit ;;
-    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
-       echo c4-convex-bsd
-        exit ;;
-    CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    CRAY*[A-Z]90:*:*:*)
-       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
-       | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-             -e 's/\.[^.]*$/.X/'
-       exit ;;
-    CRAY*TS:*:*:*)
-       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    CRAY*T3E:*:*:*)
-       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    CRAY*SV1:*:*:*)
-       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    *:UNICOS/mp:*:*)
-       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-       FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
-    5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-       exit ;;
-    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-       exit ;;
-    sparc*:BSD/OS:*:*)
-       echo sparc-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
-    *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
-    *:FreeBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit ;;
-    i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
-       exit ;;
-    i*:MINGW*:*)
-       echo ${UNAME_MACHINE}-pc-mingw32
-       exit ;;
-    i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
-       exit ;;
-    i*:PW*:*)
-       echo ${UNAME_MACHINE}-pc-pw32
-       exit ;;
-    x86:Interix*:[34]*)
-       echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-       exit ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-       echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-       # UNAME_MACHINE based on the output of uname instead of i386?
-       echo i586-pc-interix
-       exit ;;
-    i*:UWIN*:*)
-       echo ${UNAME_MACHINE}-pc-uwin
-       exit ;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-       echo x86_64-unknown-cygwin
-       exit ;;
-    p*:CYGWIN*:*)
-       echo powerpcle-unknown-cygwin
-       exit ;;
-    prep*:SunOS:5.*:*)
-       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    *:GNU:*:*)
-       # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-       exit ;;
-    *:GNU/*:*:*)
-       # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-       exit ;;
-    i*86:Minix:*:*)
-       echo ${UNAME_MACHINE}-pc-minix
-       exit ;;
-    arm*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    cris:Linux:*:*)
-       echo cris-axis-linux-gnu
-       exit ;;
-    crisv32:Linux:*:*)
-       echo crisv32-axis-linux-gnu
-       exit ;;
-    frv:Linux:*:*)
-       echo frv-unknown-linux-gnu
-       exit ;;
-    ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    mips:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #undef CPU
-       #undef mips
-       #undef mipsel
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mipsel
-       #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips
-       #else
-       CPU=
-       #endif
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-       ;;
-    mips64:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #undef CPU
-       #undef mips64
-       #undef mips64el
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mips64el
-       #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips64
-       #else
-       CPU=
-       #endif
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-       ;;
-    or32:Linux:*:*)
-       echo or32-unknown-linux-gnu
-       exit ;;
-    ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
-       exit ;;
-    ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
-       exit ;;
-    alpha:Linux:*:*)
-       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-         EV5)   UNAME_MACHINE=alphaev5 ;;
-         EV56)  UNAME_MACHINE=alphaev56 ;;
-         PCA56) UNAME_MACHINE=alphapca56 ;;
-         PCA57) UNAME_MACHINE=alphapca56 ;;
-         EV6)   UNAME_MACHINE=alphaev6 ;;
-         EV67)  UNAME_MACHINE=alphaev67 ;;
-         EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-       exit ;;
-    parisc:Linux:*:* | hppa:Linux:*:*)
-       # Look for CPU level
-       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
-       esac
-       exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
-       exit ;;
-    s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux
-       exit ;;
-    sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
-       exit ;;
-    i*86:Linux:*:*)
-       # The BFD linker knows what the default object file format is, so
-       # first see if it will tell us. cd to the root directory to prevent
-       # problems with other programs or directories called `ld' in the path.
-       # Set LC_ALL=C to ensure ld outputs messages in English.
-       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-                        | sed -ne '/supported targets:/!d
-                                   s/[         ][      ]*/ /g
-                                   s/.*supported targets: *//
-                                   s/ .*//
-                                   p'`
-        case "$ld_supported_targets" in
-         elf32-i386)
-               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-               ;;
-         a.out-i386-linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit ;;
-         coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit ;;
-         "")
-               # Either a pre-BFD a.out linker (linux-gnuoldld) or
-               # one that does not give us useful --help.
-               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit ;;
-       esac
-       # Determine whether the default compiler is a.out or elf
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <features.h>
-       #ifdef __ELF__
-       # ifdef __GLIBC__
-       #  if __GLIBC__ >= 2
-       LIBC=gnu
-       #  else
-       LIBC=gnulibc1
-       #  endif
-       # else
-       LIBC=gnulibc1
-       # endif
-       #else
-       #ifdef __INTEL_COMPILER
-       LIBC=gnu
-       #else
-       LIBC=gnuaout
-       #endif
-       #endif
-       #ifdef __dietlibc__
-       LIBC=dietlibc
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-       test x"${LIBC}" != x && {
-               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-               exit
-       }
-       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
-       ;;
-    i*86:DYNIX/ptx:4*:*)
-       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
-       # earlier versions are messed up and put the nodename in both
-       # sysname and nodename.
-       echo i386-sequent-sysv4
-       exit ;;
-    i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
-       # I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
-       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-       exit ;;
-    i*86:OS/2:*:*)
-       # If we were able to find `uname', then EMX Unix compatibility
-       # is probably installed.
-       echo ${UNAME_MACHINE}-pc-os2-emx
-       exit ;;
-    i*86:XTS-300:*:STOP)
-       echo ${UNAME_MACHINE}-unknown-stop
-       exit ;;
-    i*86:atheos:*:*)
-       echo ${UNAME_MACHINE}-unknown-atheos
-       exit ;;
-    i*86:syllable:*:*)
-       echo ${UNAME_MACHINE}-pc-syllable
-       exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
-       if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
-       else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
-       fi
-       exit ;;
-    i*86:*:5:[678]*)
-       # UnixWare 7.x, OpenUNIX and OpenServer 6.
-       case `/bin/uname -X | grep "^Machine"` in
-           *486*)           UNAME_MACHINE=i486 ;;
-           *Pentium)        UNAME_MACHINE=i586 ;;
-           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
-       esac
-       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-       exit ;;
-    i*86:*:3.2:*)
-       if test -f /usr/options/cb.name; then
-               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
-       elif /bin/uname -X 2>/dev/null >/dev/null ; then
-               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
-               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
-               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
-                       && UNAME_MACHINE=i586
-               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
-                       && UNAME_MACHINE=i686
-               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
-                       && UNAME_MACHINE=i686
-               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
-       else
-               echo ${UNAME_MACHINE}-pc-sysv32
-       fi
-       exit ;;
-    pc:*:*:*)
-       # Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-       echo i386-pc-msdosdjgpp
-        exit ;;
-    Intel:Mach:3*:*)
-       echo i386-pc-mach3
-       exit ;;
-    paragon:*:*:*)
-       echo i860-intel-osf1
-       exit ;;
-    i860:*:4.*:*) # i860-SVR4
-       if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
-       else # Add other i860-SVR4 vendors below as they are discovered.
-         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
-       fi
-       exit ;;
-    mini*:CTIX:SYS*5:*)
-       # "miniframe"
-       echo m68010-convergent-sysv
-       exit ;;
-    mc68k:UNIX:SYSTEM5:3.51m)
-       echo m68k-convergent-sysv
-       exit ;;
-    M680?0:D-NIX:5.3:*)
-       echo m68k-diab-dnix
-       exit ;;
-    M68*:*:R3V[5678]*:*)
-       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
-       OS_REL=''
-       test -r /etc/.relid \
-       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
-    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-       echo m68k-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    mc68030:UNIX_System_V:4.*:*)
-       echo m68k-atari-sysv4
-       exit ;;
-    TSUNAMI:LynxOS:2.*:*)
-       echo sparc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    rs6000:LynxOS:2.*:*)
-       echo rs6000-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
-       echo powerpc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    SM[BE]S:UNIX_SV:*:*)
-       echo mips-dde-sysv${UNAME_RELEASE}
-       exit ;;
-    RM*:ReliantUNIX-*:*:*)
-       echo mips-sni-sysv4
-       exit ;;
-    RM*:SINIX-*:*:*)
-       echo mips-sni-sysv4
-       exit ;;
-    *:SINIX-*:*:*)
-       if uname -p 2>/dev/null >/dev/null ; then
-               UNAME_MACHINE=`(uname -p) 2>/dev/null`
-               echo ${UNAME_MACHINE}-sni-sysv4
-       else
-               echo ns32k-sni-sysv
-       fi
-       exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel@ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
-    *:UNIX_System_V:4*:FTX*)
-       # From Gerald Hewes <hewes@openmarket.com>.
-       # How about differentiating between stratus architectures? -djm
-       echo hppa1.1-stratus-sysv4
-       exit ;;
-    *:*:*:FTX*)
-       # From seanf@swdc.stratus.com.
-       echo i860-stratus-sysv4
-       exit ;;
-    i*86:VOS:*:*)
-       # From Paul.Green@stratus.com.
-       echo ${UNAME_MACHINE}-stratus-vos
-       exit ;;
-    *:VOS:*:*)
-       # From Paul.Green@stratus.com.
-       echo hppa1.1-stratus-vos
-       exit ;;
-    mc68*:A/UX:*:*)
-       echo m68k-apple-aux${UNAME_RELEASE}
-       exit ;;
-    news*:NEWS-OS:6*:*)
-       echo mips-sony-newsos6
-       exit ;;
-    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-       if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
-       else
-               echo mips-unknown-sysv${UNAME_RELEASE}
-       fi
-        exit ;;
-    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
-       echo powerpc-be-beos
-       exit ;;
-    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
-       echo powerpc-apple-beos
-       exit ;;
-    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
-       echo i586-pc-beos
-       exit ;;
-    SX-4:SUPER-UX:*:*)
-       echo sx4-nec-superux${UNAME_RELEASE}
-       exit ;;
-    SX-5:SUPER-UX:*:*)
-       echo sx5-nec-superux${UNAME_RELEASE}
-       exit ;;
-    SX-6:SUPER-UX:*:*)
-       echo sx6-nec-superux${UNAME_RELEASE}
-       exit ;;
-    Power*:Rhapsody:*:*)
-       echo powerpc-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
-    *:Rhapsody:*:*)
-       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
-    *:Darwin:*:*)
-       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       case $UNAME_PROCESSOR in
-           *86) UNAME_PROCESSOR=i686 ;;
-           unknown) UNAME_PROCESSOR=powerpc ;;
-       esac
-       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-       exit ;;
-    *:procnto*:*:* | *:QNX:[0123456789]*:*)
-       UNAME_PROCESSOR=`uname -p`
-       if test "$UNAME_PROCESSOR" = "x86"; then
-               UNAME_PROCESSOR=i386
-               UNAME_MACHINE=pc
-       fi
-       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-       exit ;;
-    *:QNX:*:4*)
-       echo i386-pc-qnx
-       exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
-       echo nse-tandem-nsk${UNAME_RELEASE}
-       exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-       echo nsr-tandem-nsk${UNAME_RELEASE}
-       exit ;;
-    *:NonStop-UX:*:*)
-       echo mips-compaq-nonstopux
-       exit ;;
-    BS2000:POSIX*:*:*)
-       echo bs2000-siemens-sysv
-       exit ;;
-    DS/*:UNIX_System_V:*:*)
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-       exit ;;
-    *:Plan9:*:*)
-       # "uname -m" is not consistent, so use $cputype instead. 386
-       # is converted to i386 for consistency with other x86
-       # operating systems.
-       if test "$cputype" = "386"; then
-           UNAME_MACHINE=i386
-       else
-           UNAME_MACHINE="$cputype"
-       fi
-       echo ${UNAME_MACHINE}-unknown-plan9
-       exit ;;
-    *:TOPS-10:*:*)
-       echo pdp10-unknown-tops10
-       exit ;;
-    *:TENEX:*:*)
-       echo pdp10-unknown-tenex
-       exit ;;
-    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-       echo pdp10-dec-tops20
-       exit ;;
-    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-       echo pdp10-xkl-tops20
-       exit ;;
-    *:TOPS-20:*:*)
-       echo pdp10-unknown-tops20
-       exit ;;
-    *:ITS:*:*)
-       echo pdp10-unknown-its
-       exit ;;
-    SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
-       exit ;;
-    *:DragonFly:*:*)
-       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit ;;
-    *:*VMS:*:*)
-       UNAME_MACHINE=`(uname -p) 2>/dev/null`
-       case "${UNAME_MACHINE}" in
-           A*) echo alpha-dec-vms ; exit ;;
-           I*) echo ia64-dec-vms ; exit ;;
-           V*) echo vax-dec-vms ; exit ;;
-       esac ;;
-    *:XENIX:*:SysV)
-       echo i386-pc-xenix
-       exit ;;
-    i*86:skyos:*:*)
-       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
-       exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-          "4"
-#else
-         ""
-#endif
-         ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-       printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-       printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-       { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-       echo c1-convex-bsd
-       exit ;;
-    c2*)
-       if getsysinfo -f scalar_acc
-       then echo c32-convex-bsd
-       else echo c2-convex-bsd
-       fi
-       exit ;;
-    c34*)
-       echo c34-convex-bsd
-       exit ;;
-    c38*)
-       echo c38-convex-bsd
-       exit ;;
-    c4*)
-       echo c4-convex-bsd
-       exit ;;
-    esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
-and
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo               = `(hostinfo) 2>/dev/null`
-/bin/universe          = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch              = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/source4/cluster/ctdb/config.h.in b/source4/cluster/ctdb/config.h.in
deleted file mode 100644 (file)
index 7e04473..0000000
+++ /dev/null
@@ -1,756 +0,0 @@
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Whether strndup is broken */
-#undef BROKEN_STRNDUP
-
-/* Whether strnlen is broken */
-#undef BROKEN_STRNLEN
-
-/* Define to 1 if you have the <acl/libacl.h> header file. */
-#undef HAVE_ACL_LIBACL_H
-
-/* Define to 1 if you have the <alloca.h> header file. */
-#undef HAVE_ALLOCA_H
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#undef HAVE_ARPA_INET_H
-
-/* Define to 1 if you have the `asprintf' function. */
-#undef HAVE_ASPRINTF
-
-/* Whether the bool type is available */
-#undef HAVE_BOOL
-
-/* Define to 1 if you have the `bzero' function. */
-#undef HAVE_BZERO
-
-/* Whether there is a C99 compliant vsnprintf */
-#undef HAVE_C99_VSNPRINTF
-
-/* Define to 1 if you have the `chroot' function. */
-#undef HAVE_CHROOT
-
-/* Define to 1 if you have the `chsize' function. */
-#undef HAVE_CHSIZE
-
-/* Whether or not we have comparison_fn_t */
-#undef HAVE_COMPARISON_FN_T
-
-/* Define to 1 if you have the <compat.h> header file. */
-#undef HAVE_COMPAT_H
-
-/* Define to 1 if you have the <ctype.h> header file. */
-#undef HAVE_CTYPE_H
-
-/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_ASPRINTF
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SNPRINTF
-
-/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VASPRINTF
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VSNPRINTF
-
-/* Define to 1 if you have the <direct.h> header file. */
-#undef HAVE_DIRECT_H
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_DIRENT_H
-
-/* Define to 1 if you have the `dlclose' function. */
-#undef HAVE_DLCLOSE
-
-/* Define to 1 if you have the `dlerror' function. */
-#undef HAVE_DLERROR
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the `dlopen' function. */
-#undef HAVE_DLOPEN
-
-/* Define to 1 if you have the `dlsym' function. */
-#undef HAVE_DLSYM
-
-/* Define to 1 if you have the `epoll_create' function. */
-#undef HAVE_EPOLL_CREATE
-
-/* Whether errno() is available */
-#undef HAVE_ERRNO_DECL
-
-/* Whether epoll available */
-#undef HAVE_EVENTS_EPOLL
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the <float.h> header file. */
-#undef HAVE_FLOAT_H
-
-/* Define to 1 if you have the <fnmatch.h> header file. */
-#undef HAVE_FNMATCH_H
-
-/* Define to 1 if you have the `ftruncate' function. */
-#undef HAVE_FTRUNCATE
-
-/* Whether there is a __FUNCTION__ macro */
-#undef HAVE_FUNCTION_MACRO
-
-/* Define to 1 if you have the `getdents' function. */
-#undef HAVE_GETDENTS
-
-/* Define to 1 if you have the `getdirentries' function. */
-#undef HAVE_GETDIRENTRIES
-
-/* Define to 1 if you have the <getopt.h> header file. */
-#undef HAVE_GETOPT_H
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getpgrp' function. */
-#undef HAVE_GETPGRP
-
-/* Define to 1 if you have the <grp.h> header file. */
-#undef HAVE_GRP_H
-
-/* Whether the compiler supports immediate structures */
-#undef HAVE_IMMEDIATE_STRUCTURES
-
-/* Define to 1 if you have the <infiniband/verbs.h> header file. */
-#undef HAVE_INFINIBAND_VERBS_H
-
-/* Define to 1 if you have the `initgroups' function. */
-#undef HAVE_INITGROUPS
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `ibverbs' library (-libverbs). */
-#undef HAVE_LIBIBVERBS
-
-/* Define to 1 if you have the `rdmacm' library (-lrdmacm). */
-#undef HAVE_LIBRDMACM
-
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
-
-/* Define to 1 if you have the `lstat' function. */
-#undef HAVE_LSTAT
-
-/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
-/* Define if target mkdir supports mode option */
-#undef HAVE_MKDIR_MODE
-
-/* Define to 1 if you have the `mkdtemp' function. */
-#undef HAVE_MKDTEMP
-
-/* Define to 1 if you have the `mktime' function. */
-#undef HAVE_MKTIME
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the <mntent.h> header file. */
-#undef HAVE_MNTENT_H
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-#undef HAVE_NDIR_H
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
-/* Define to 1 if you have the <netinet/in_ip.h> header file. */
-#undef HAVE_NETINET_IN_IP_H
-
-/* Define to 1 if you have the <netinet/in_systm.h> header file. */
-#undef HAVE_NETINET_IN_SYSTM_H
-
-/* Define to 1 if you have the <netinet/ip.h> header file. */
-#undef HAVE_NETINET_IP_H
-
-/* Define to 1 if you have the <netinet/tcp.h> header file. */
-#undef HAVE_NETINET_TCP_H
-
-/* usability of net/if.h */
-#undef HAVE_NET_IF_H
-
-/* Whether the open(2) accepts O_DIRECT */
-#undef HAVE_OPEN_O_DIRECT
-
-/* Define to 1 if you have the `pipe' function. */
-#undef HAVE_PIPE
-
-/* Define to 1 if you have the <popt.h> header file. */
-#undef HAVE_POPT_H
-
-/* Define to 1 if you have the `pread' function. */
-#undef HAVE_PREAD
-
-/* Whether pread() is available */
-#undef HAVE_PREAD_DECL
-
-/* Define to 1 if you have the `printf' function. */
-#undef HAVE_PRINTF
-
-/* Define to 1 if you have the <pwd.h> header file. */
-#undef HAVE_PWD_H
-
-/* Define to 1 if you have the `pwrite' function. */
-#undef HAVE_PWRITE
-
-/* Whether pwrite() is available */
-#undef HAVE_PWRITE_DECL
-
-/* Define to 1 if you have the `rand' function. */
-#undef HAVE_RAND
-
-/* Define to 1 if you have the `random' function. */
-#undef HAVE_RANDOM
-
-/* Define to 1 if you have the <rdma/rdma_cma.h> header file. */
-#undef HAVE_RDMA_RDMA_CMA_H
-
-/* Define to 1 if you have the `rename' function. */
-#undef HAVE_RENAME
-
-/* Define to 1 if you have the <sched.h> header file. */
-#undef HAVE_SCHED_H
-
-/* Define to 1 if you have the `sched_setscheduler' function. */
-#undef HAVE_SCHED_SETSCHEDULER
-
-/* Whether mkstemp is secure */
-#undef HAVE_SECURE_MKSTEMP
-
-/* Define to 1 if you have the `setbuffer' function. */
-#undef HAVE_SETBUFFER
-
-/* Define to 1 if you have the `setegid' function. */
-#undef HAVE_SETEGID
-
-/* Define to 1 if you have the `setenv' function. */
-#undef HAVE_SETENV
-
-/* Whether setenv() is available */
-#undef HAVE_SETENV_DECL
-
-/* Define to 1 if you have the `seteuid' function. */
-#undef HAVE_SETEUID
-
-/* Define to 1 if you have the <setjmp.h> header file. */
-#undef HAVE_SETJMP_H
-
-/* Define to 1 if you have the `setlinebuf' function. */
-#undef HAVE_SETLINEBUF
-
-/* Define to 1 if you have the `setresgid' function. */
-#undef HAVE_SETRESGID
-
-/* Whether setresgid() is available */
-#undef HAVE_SETRESGID_DECL
-
-/* Define to 1 if you have the `setresuid' function. */
-#undef HAVE_SETRESUID
-
-/* Whether setresuid() is available */
-#undef HAVE_SETRESUID_DECL
-
-/* Define to 1 if you have the <shadow.h> header file. */
-#undef HAVE_SHADOW_H
-
-/* Whether we have the atomic_t variable type */
-#undef HAVE_SIG_ATOMIC_T_TYPE
-
-/* Define to 1 if you have the `snprintf' function. */
-#undef HAVE_SNPRINTF
-
-/* Define to 1 if you have the `socketpair' function. */
-#undef HAVE_SOCKETPAIR
-
-/* Whether the sockaddr_in struct has a sin_len property */
-#undef HAVE_SOCK_SIN_LEN
-
-/* Define to 1 if you have the `srand' function. */
-#undef HAVE_SRAND
-
-/* Define to 1 if you have the `srandom' function. */
-#undef HAVE_SRANDOM
-
-/* Define to 1 if you have the <standards.h> header file. */
-#undef HAVE_STANDARDS_H
-
-/* Define to 1 if you have the <stdarg.h> header file. */
-#undef HAVE_STDARG_H
-
-/* Define to 1 if you have the <stdbool.h> header file. */
-#undef HAVE_STDBOOL_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#undef HAVE_STDIO_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strcasestr' function. */
-#undef HAVE_STRCASESTR
-
-/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
-
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
-/* Define to 1 if you have the `strftime' function. */
-#undef HAVE_STRFTIME
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strlcat' function. */
-#undef HAVE_STRLCAT
-
-/* Define to 1 if you have the `strlcpy' function. */
-#undef HAVE_STRLCPY
-
-/* Define to 1 if you have the `strndup' function. */
-#undef HAVE_STRNDUP
-
-/* Define to 1 if you have the `strnlen' function. */
-#undef HAVE_STRNLEN
-
-/* Define to 1 if you have the `strtok_r' function. */
-#undef HAVE_STRTOK_R
-
-/* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
-
-/* Define to 1 if you have the `strtoq' function. */
-#undef HAVE_STRTOQ
-
-/* Define to 1 if you have the `strtoull' function. */
-#undef HAVE_STRTOULL
-
-/* Define to 1 if you have the `strtouq' function. */
-#undef HAVE_STRTOUQ
-
-/* Define to 1 if `st_rdev' is member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_RDEV
-
-/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use
-   `HAVE_STRUCT_STAT_ST_RDEV' instead. */
-#undef HAVE_ST_RDEV
-
-/* Define to 1 if you have the `syslog' function. */
-#undef HAVE_SYSLOG
-
-/* Define to 1 if you have the <syslog.h> header file. */
-#undef HAVE_SYSLOG_H
-
-/* Define to 1 if you have the <sys/acl.h> header file. */
-#undef HAVE_SYS_ACL_H
-
-/* Define to 1 if you have the <sys/capability.h> header file. */
-#undef HAVE_SYS_CAPABILITY_H
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_DIR_H
-
-/* Define to 1 if you have the <sys/epoll.h> header file. */
-#undef HAVE_SYS_EPOLL_H
-
-/* Define to 1 if you have the <sys/fcntl.h> header file. */
-#undef HAVE_SYS_FCNTL_H
-
-/* Define to 1 if you have the <sys/filio.h> header file. */
-#undef HAVE_SYS_FILIO_H
-
-/* Define to 1 if you have the <sys/filsys.h> header file. */
-#undef HAVE_SYS_FILSYS_H
-
-/* Define to 1 if you have the <sys/fs/s5param.h> header file. */
-#undef HAVE_SYS_FS_S5PARAM_H
-
-/* Define to 1 if you have the <sys/id.h> header file. */
-#undef HAVE_SYS_ID_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/ipc.h> header file. */
-#undef HAVE_SYS_IPC_H
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/mode.h> header file. */
-#undef HAVE_SYS_MODE_H
-
-/* Define to 1 if you have the <sys/mount.h> header file. */
-#undef HAVE_SYS_MOUNT_H
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_NDIR_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/priv.h> header file. */
-#undef HAVE_SYS_PRIV_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/security.h> header file. */
-#undef HAVE_SYS_SECURITY_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/shm.h> header file. */
-#undef HAVE_SYS_SHM_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/sockio.h> header file. */
-#undef HAVE_SYS_SOCKIO_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/syslog.h> header file. */
-#undef HAVE_SYS_SYSLOG_H
-
-/* Define to 1 if you have the <sys/termio.h> header file. */
-#undef HAVE_SYS_TERMIO_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <termio.h> header file. */
-#undef HAVE_TERMIO_H
-
-/* Define to 1 if you have the `timegm' function. */
-#undef HAVE_TIMEGM
-
-/* Define to 1 if you have the <time.h> header file. */
-#undef HAVE_TIME_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `unsetenv' function. */
-#undef HAVE_UNSETENV
-
-/* Define to 1 if you have the `usleep' function. */
-#undef HAVE_USLEEP
-
-/* Define to 1 if you have the `utime' function. */
-#undef HAVE_UTIME
-
-/* Define to 1 if you have the <utime.h> header file. */
-#undef HAVE_UTIME_H
-
-/* Define to 1 if you have the <vararg.h> header file. */
-#undef HAVE_VARARG_H
-
-/* Define to 1 if you have the `vasprintf' function. */
-#undef HAVE_VASPRINTF
-
-/* Whether va_copy() is available */
-#undef HAVE_VA_COPY
-
-/* Whether the C compiler understands volatile */
-#undef HAVE_VOLATILE
-
-/* Define to 1 if you have the `vsnprintf' function. */
-#undef HAVE_VSNPRINTF
-
-/* Define to 1 if you have the `vsyslog' function. */
-#undef HAVE_VSYSLOG
-
-/* Define to 1 if you have the `waitpid' function. */
-#undef HAVE_WAITPID
-
-/* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
-
-/* Define to 1 if you have the <winsock2.h> header file. */
-#undef HAVE_WINSOCK2_H
-
-/* Define to 1 if you have the <ws2tcpip.h> header file. */
-#undef HAVE_WS2TCPIP_H
-
-/* Whether the _Bool type is available */
-#undef HAVE__Bool
-
-/* Whether the __VA_ARGS__ macro is available */
-#undef HAVE__VA_ARGS__MACRO
-
-/* Define to 1 if you have the `__strtoll' function. */
-#undef HAVE___STRTOLL
-
-/* Define to 1 if you have the `__strtoull' function. */
-#undef HAVE___STRTOULL
-
-/* Whether __va_copy() is available */
-#undef HAVE___VA_COPY
-
-/* Whether there is a __func__ macro */
-#undef HAVE_func_MACRO
-
-/* Whether MMAP is broken */
-#undef MMAP_BLACKLIST
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Whether getpass should be replaced */
-#undef REPLACE_GETPASS
-
-/* Whether inet_ntoa should be replaced */
-#undef REPLACE_INET_NTOA
-
-/* replace readdir */
-#undef REPLACE_READDIR
-
-/* replace readdir using getdents() */
-#undef REPLACE_READDIR_GETDENTS
-
-/* replace readdir using getdirentries() */
-#undef REPLACE_READDIR_GETDIRENTRIES
-
-/* Whether strptime should be replaced */
-#undef REPLACE_STRPTIME
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#undef RETSIGTYPE
-
-/* Whether seekdir returns an int */
-#undef SEEKDIR_RETURNS_INT
-
-/* The size of `char', as computed by sizeof. */
-#undef SIZEOF_CHAR
-
-/* The size of `int', as computed by sizeof. */
-#undef SIZEOF_INT
-
-/* The size of `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* The size of `off_t', as computed by sizeof. */
-#undef SIZEOF_OFF_T
-
-/* The size of `short', as computed by sizeof. */
-#undef SIZEOF_SHORT
-
-/* The size of `size_t', as computed by sizeof. */
-#undef SIZEOF_SIZE_T
-
-/* The size of `ssize_t', as computed by sizeof. */
-#undef SIZEOF_SSIZE_T
-
-/* The size of `void *', as computed by sizeof. */
-#undef SIZEOF_VOID_P
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Whether telldir takes a const pointer */
-#undef TELLDIR_TAKES_CONST_DIR
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Use infiniband */
-#undef USE_INFINIBAND
-
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
-
-/* Define to 1 if on AIX 3.
-   System headers sometimes define this.
-   We just want to avoid a redefinition error message.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-#ifndef _OSF_SOURCE
-# define _OSF_SOURCE 1
-#endif
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Whether to enable POSIX support */
-#undef _POSIX_C_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Whether to enable System V compatibility */
-#undef _SYSV
-
-#ifndef _XOPEN_SOURCE_EXTENDED
-# define _XOPEN_SOURCE_EXTENDED 1
-#endif
-
-/* Enable extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef gid_t
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
-#endif
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#undef ino_t
-
-/* Define to `short' if <sys/types.h> does not define. */
-#undef int16_t
-
-/* Define to `long' if <sys/types.h> does not define. */
-#undef int32_t
-
-/* Define to `long long' if <sys/types.h> does not define. */
-#undef int64_t
-
-/* Define to `char' if <sys/types.h> does not define. */
-#undef int8_t
-
-/* Define to `unsigned long long' if <sys/types.h> does not define. */
-#undef intptr_t
-
-/* Define to `off_t' if <sys/types.h> does not define. */
-#undef loff_t
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef mode_t
-
-/* Define to `long int' if <sys/types.h> does not define. */
-#undef off_t
-
-/* Define to `loff_t' if <sys/types.h> does not define. */
-#undef offset_t
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned long long' if <sys/types.h> does not define. */
-#undef ptrdiff_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* Socket length type */
-#undef socklen_t
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef ssize_t
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef uid_t
-
-/* Define to `unsigned short' if <sys/types.h> does not define. */
-#undef uint16_t
-
-/* Define to `unsigned long' if <sys/types.h> does not define. */
-#undef uint32_t
-
-/* Define to `unsigned long long' if <sys/types.h> does not define. */
-#undef uint64_t
-
-/* Define to `unsigned char' if <sys/types.h> does not define. */
-#undef uint8_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef uint_t
diff --git a/source4/cluster/ctdb/config.mk b/source4/cluster/ctdb/config.mk
deleted file mode 100644 (file)
index d164d71..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-##################
-[SUBSYSTEM::brlock_ctdb]
-PUBLIC_DEPENDENCIES = ctdb
-
-brlock_ctdb_OBJ_FILES = $(ctdbsrcdir)/brlock_ctdb.o
-
-##################
-[SUBSYSTEM::opendb_ctdb]
-PUBLIC_DEPENDENCIES = ctdb
-
-opendb_ctdb_OBJ_FILES = $(ctdbsrcdir)/opendb_ctdb.o
-
-##################
-[SUBSYSTEM::ctdb]
-PUBLIC_DEPENDENCIES = TDB_WRAP LIBTALLOC LIBEVENTS
-
-ctdb_OBJ_FILES = $(addprefix $(ctdbsrcdir)/, \
-               ctdb_cluster.o \
-               client/ctdb_client.o \
-               common/ctdb_io.o \
-               common/ctdb_ltdb.o \
-               common/ctdb_message.o \
-               common/ctdb_util.o)
-
diff --git a/source4/cluster/ctdb/config.sub b/source4/cluster/ctdb/config.sub
deleted file mode 100755 (executable)
index 665fc1b..0000000
+++ /dev/null
@@ -1,1577 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
-timestamp='2007-07-10'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support.  The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
-       $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )        # Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help"
-       exit 1 ;;
-
-    *local*)
-       # First pass through any local machine types.
-       echo $1
-       exit ;;
-
-    * )
-       break ;;
-  esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
-    exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
-    exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
-  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-       -sun*os*)
-               # Prevent following clause from handling this invalid input.
-               ;;
-       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray)
-               os=
-               basic_machine=$1
-               ;;
-       -sim | -cisco | -oki | -wec | -winbond)
-               os=
-               basic_machine=$1
-               ;;
-       -scout)
-               ;;
-       -wrs)
-               os=-vxworks
-               basic_machine=$1
-               ;;
-       -chorusos*)
-               os=-chorusos
-               basic_machine=$1
-               ;;
-       -chorusrdb)
-               os=-chorusrdb
-               basic_machine=$1
-               ;;
-       -hiux*)
-               os=-hiuxwe2
-               ;;
-       -sco5)
-               os=-sco3.2v5
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco4)
-               os=-sco3.2v4
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2.[4-9]*)
-               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2v[4-9]*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco*)
-               os=-sco3.2v2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -udk*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -isc)
-               os=-isc2.2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -clix*)
-               basic_machine=clipper-intergraph
-               ;;
-       -isc*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -lynx*)
-               os=-lynxos
-               ;;
-       -ptx*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
-               ;;
-       -windowsnt*)
-               os=`echo $os | sed -e 's/windowsnt/winnt/'`
-               ;;
-       -psos*)
-               os=-psos
-               ;;
-       -mint | -mint[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
-               ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
-       # Recognize the basic CPU types without company name.
-       # Some are omitted here because they have special meanings below.
-       1750a | 580 \
-       | a29k \
-       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-       | am33_2.0 \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
-       | bfin \
-       | c4x | clipper \
-       | d10v | d30v | dlx | dsp16xx \
-       | fr30 | frv \
-       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-       | i370 | i860 | i960 | ia64 \
-       | ip2k | iq2000 \
-       | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
-       | mips | mipsbe | mipseb | mipsel | mipsle \
-       | mips16 \
-       | mips64 | mips64el \
-       | mips64vr | mips64vrel \
-       | mips64orion | mips64orionel \
-       | mips64vr4100 | mips64vr4100el \
-       | mips64vr4300 | mips64vr4300el \
-       | mips64vr5000 | mips64vr5000el \
-       | mips64vr5900 | mips64vr5900el \
-       | mipsisa32 | mipsisa32el \
-       | mipsisa32r2 | mipsisa32r2el \
-       | mipsisa64 | mipsisa64el \
-       | mipsisa64r2 | mipsisa64r2el \
-       | mipsisa64sb1 | mipsisa64sb1el \
-       | mipsisa64sr71k | mipsisa64sr71kel \
-       | mipstx39 | mipstx39el \
-       | mn10200 | mn10300 \
-       | ms1 \
-       | msp430 \
-       | ns16k | ns32k \
-       | or32 \
-       | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
-       | pyramid \
-       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
-       | sh64 | sh64le \
-       | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
-       | sparcv8 | sparcv9 | sparcv9b \
-       | strongarm \
-       | tahoe | thumb | tic4x | tic80 | tron \
-       | v850 | v850e \
-       | we32k \
-       | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
-       | z8k)
-               basic_machine=$basic_machine-unknown
-               ;;
-       m32c)
-               basic_machine=$basic_machine-unknown
-               ;;
-       m6811 | m68hc11 | m6812 | m68hc12)
-               # Motorola 68HC11/12.
-               basic_machine=$basic_machine-unknown
-               os=-none
-               ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
-               ;;
-
-       # We use `pc' rather than `unknown'
-       # because (1) that's what they normally are, and
-       # (2) the word "unknown" tends to confuse beginning users.
-       i*86 | x86_64)
-         basic_machine=$basic_machine-pc
-         ;;
-       # Object if more than one company name word.
-       *-*-*)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
-               ;;
-       # Recognize the basic CPU types with company name.
-       580-* \
-       | a29k-* \
-       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
-       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* \
-       | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
-       | clipper-* | craynv-* | cydra-* \
-       | d10v-* | d30v-* | dlx-* \
-       | elxsi-* \
-       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
-       | h8300-* | h8500-* \
-       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-       | i*86-* | i860-* | i960-* | ia64-* \
-       | ip2k-* | iq2000-* \
-       | m32r-* | m32rle-* \
-       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* \
-       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-       | mips16-* \
-       | mips64-* | mips64el-* \
-       | mips64vr-* | mips64vrel-* \
-       | mips64orion-* | mips64orionel-* \
-       | mips64vr4100-* | mips64vr4100el-* \
-       | mips64vr4300-* | mips64vr4300el-* \
-       | mips64vr5000-* | mips64vr5000el-* \
-       | mips64vr5900-* | mips64vr5900el-* \
-       | mipsisa32-* | mipsisa32el-* \
-       | mipsisa32r2-* | mipsisa32r2el-* \
-       | mipsisa64-* | mipsisa64el-* \
-       | mipsisa64r2-* | mipsisa64r2el-* \
-       | mipsisa64sb1-* | mipsisa64sb1el-* \
-       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
-       | mipstx39-* | mipstx39el-* \
-       | mmix-* \
-       | ms1-* \
-       | msp430-* \
-       | none-* | np1-* | ns16k-* | ns32k-* \
-       | orion-* \
-       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
-       | pyramid-* \
-       | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
-       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
-       | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
-       | tahoe-* | thumb-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-       | tron-* \
-       | v850-* | v850e-* | vax-* \
-       | we32k-* \
-       | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
-       | xstormy16-* | xtensa-* \
-       | ymp-* \
-       | z8k-*)
-               ;;
-       m32c-*)
-               ;;
-       # Recognize the various machine names and aliases which stand
-       # for a CPU type and a company and sometimes even an OS.
-       386bsd)
-               basic_machine=i386-unknown
-               os=-bsd
-               ;;
-       3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-               basic_machine=m68000-att
-               ;;
-       3b*)
-               basic_machine=we32k-att
-               ;;
-       a29khif)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       abacus)
-               basic_machine=abacus-unknown
-               ;;
-       adobe68k)
-               basic_machine=m68010-adobe
-               os=-scout
-               ;;
-       alliant | fx80)
-               basic_machine=fx80-alliant
-               ;;
-       altos | altos3068)
-               basic_machine=m68k-altos
-               ;;
-       am29k)
-               basic_machine=a29k-none
-               os=-bsd
-               ;;
-       amd64)
-               basic_machine=x86_64-pc
-               ;;
-       amd64-*)
-               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       amdahl)
-               basic_machine=580-amdahl
-               os=-sysv
-               ;;
-       amiga | amiga-*)
-               basic_machine=m68k-unknown
-               ;;
-       amigaos | amigados)
-               basic_machine=m68k-unknown
-               os=-amigaos
-               ;;
-       amigaunix | amix)
-               basic_machine=m68k-unknown
-               os=-sysv4
-               ;;
-       apollo68)
-               basic_machine=m68k-apollo
-               os=-sysv
-               ;;
-       apollo68bsd)
-               basic_machine=m68k-apollo
-               os=-bsd
-               ;;
-       aux)
-               basic_machine=m68k-apple
-               os=-aux
-               ;;
-       balance)
-               basic_machine=ns32k-sequent
-               os=-dynix
-               ;;
-       c90)
-               basic_machine=c90-cray
-               os=-unicos
-               ;;
-       convex-c1)
-               basic_machine=c1-convex
-               os=-bsd
-               ;;
-       convex-c2)
-               basic_machine=c2-convex
-               os=-bsd
-               ;;
-       convex-c32)
-               basic_machine=c32-convex
-               os=-bsd
-               ;;
-       convex-c34)
-               basic_machine=c34-convex
-               os=-bsd
-               ;;
-       convex-c38)
-               basic_machine=c38-convex
-               os=-bsd
-               ;;
-       cray | j90)
-               basic_machine=j90-cray
-               os=-unicos
-               ;;
-       craynv)
-               basic_machine=craynv-cray
-               os=-unicosmp
-               ;;
-       cr16c)
-               basic_machine=cr16c-unknown
-               os=-elf
-               ;;
-       crds | unos)
-               basic_machine=m68k-crds
-               ;;
-       crisv32 | crisv32-* | etraxfs*)
-               basic_machine=crisv32-axis
-               ;;
-       cris | cris-* | etrax*)
-               basic_machine=cris-axis
-               ;;
-       crx)
-               basic_machine=crx-unknown
-               os=-elf
-               ;;
-       da30 | da30-*)
-               basic_machine=m68k-da30
-               ;;
-       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-               basic_machine=mips-dec
-               ;;
-       decsystem10* | dec10*)
-               basic_machine=pdp10-dec
-               os=-tops10
-               ;;
-       decsystem20* | dec20*)
-               basic_machine=pdp10-dec
-               os=-tops20
-               ;;
-       delta | 3300 | motorola-3300 | motorola-delta \
-             | 3300-motorola | delta-motorola)
-               basic_machine=m68k-motorola
-               ;;
-       delta88)
-               basic_machine=m88k-motorola
-               os=-sysv3
-               ;;
-       djgpp)
-               basic_machine=i586-pc
-               os=-msdosdjgpp
-               ;;
-       dpx20 | dpx20-*)
-               basic_machine=rs6000-bull
-               os=-bosx
-               ;;
-       dpx2* | dpx2*-bull)
-               basic_machine=m68k-bull
-               os=-sysv3
-               ;;
-       ebmon29k)
-               basic_machine=a29k-amd
-               os=-ebmon
-               ;;
-       elxsi)
-               basic_machine=elxsi-elxsi
-               os=-bsd
-               ;;
-       encore | umax | mmax)
-               basic_machine=ns32k-encore
-               ;;
-       es1800 | OSE68k | ose68k | ose | OSE)
-               basic_machine=m68k-ericsson
-               os=-ose
-               ;;
-       fx2800)
-               basic_machine=i860-alliant
-               ;;
-       genix)
-               basic_machine=ns32k-ns
-               ;;
-       gmicro)
-               basic_machine=tron-gmicro
-               os=-sysv
-               ;;
-       go32)
-               basic_machine=i386-pc
-               os=-go32
-               ;;
-       h3050r* | hiux*)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       h8300hms)
-               basic_machine=h8300-hitachi
-               os=-hms
-               ;;
-       h8300xray)
-               basic_machine=h8300-hitachi
-               os=-xray
-               ;;
-       h8500hms)
-               basic_machine=h8500-hitachi
-               os=-hms
-               ;;
-       harris)
-               basic_machine=m88k-harris
-               os=-sysv3
-               ;;
-       hp300-*)
-               basic_machine=m68k-hp
-               ;;
-       hp300bsd)
-               basic_machine=m68k-hp
-               os=-bsd
-               ;;
-       hp300hpux)
-               basic_machine=m68k-hp
-               os=-hpux
-               ;;
-       hp3k9[0-9][0-9] | hp9[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hp9k2[0-9][0-9] | hp9k31[0-9])
-               basic_machine=m68000-hp
-               ;;
-       hp9k3[2-9][0-9])
-               basic_machine=m68k-hp
-               ;;
-       hp9k6[0-9][0-9] | hp6[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hp9k7[0-79][0-9] | hp7[0-79][0-9])
-               basic_machine=hppa1.1-hp
-               ;;
-       hp9k78[0-9] | hp78[0-9])
-               # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
-               ;;
-       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-               # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
-               ;;
-       hp9k8[0-9][13679] | hp8[0-9][13679])
-               basic_machine=hppa1.1-hp
-               ;;
-       hp9k8[0-9][0-9] | hp8[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hppa-next)
-               os=-nextstep3
-               ;;
-       hppaosf)
-               basic_machine=hppa1.1-hp
-               os=-osf
-               ;;
-       hppro)
-               basic_machine=hppa1.1-hp
-               os=-proelf
-               ;;
-       i370-ibm* | ibm*)
-               basic_machine=i370-ibm
-               ;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
-       i*86v32)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv32
-               ;;
-       i*86v4*)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv4
-               ;;
-       i*86v)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv
-               ;;
-       i*86sol2)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-solaris2
-               ;;
-       i386mach)
-               basic_machine=i386-mach
-               os=-mach
-               ;;
-       i386-vsta | vsta)
-               basic_machine=i386-unknown
-               os=-vsta
-               ;;
-       iris | iris4d)
-               basic_machine=mips-sgi
-               case $os in
-                   -irix*)
-                       ;;
-                   *)
-                       os=-irix4
-                       ;;
-               esac
-               ;;
-       isi68 | isi)
-               basic_machine=m68k-isi
-               os=-sysv
-               ;;
-       m88k-omron*)
-               basic_machine=m88k-omron
-               ;;
-       magnum | m3230)
-               basic_machine=mips-mips
-               os=-sysv
-               ;;
-       merlin)
-               basic_machine=ns32k-utek
-               os=-sysv
-               ;;
-       mingw32)
-               basic_machine=i386-pc
-               os=-mingw32
-               ;;
-       miniframe)
-               basic_machine=m68000-convergent
-               ;;
-       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
-               ;;
-       mips3*-*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-               ;;
-       mips3*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-               ;;
-       monitor)
-               basic_machine=m68k-rom68k
-               os=-coff
-               ;;
-       morphos)
-               basic_machine=powerpc-unknown
-               os=-morphos
-               ;;
-       msdos)
-               basic_machine=i386-pc
-               os=-msdos
-               ;;
-       mvs)
-               basic_machine=i370-ibm
-               os=-mvs
-               ;;
-       ncr3000)
-               basic_machine=i486-ncr
-               os=-sysv4
-               ;;
-       netbsd386)
-               basic_machine=i386-unknown
-               os=-netbsd
-               ;;
-       netwinder)
-               basic_machine=armv4l-rebel
-               os=-linux
-               ;;
-       news | news700 | news800 | news900)
-               basic_machine=m68k-sony
-               os=-newsos
-               ;;
-       news1000)
-               basic_machine=m68030-sony
-               os=-newsos
-               ;;
-       news-3600 | risc-news)
-               basic_machine=mips-sony
-               os=-newsos
-               ;;
-       necv70)
-               basic_machine=v70-nec
-               os=-sysv
-               ;;
-       next | m*-next )
-               basic_machine=m68k-next
-               case $os in
-                   -nextstep* )
-                       ;;
-                   -ns2*)
-                     os=-nextstep2
-                       ;;
-                   *)
-                     os=-nextstep3
-                       ;;
-               esac
-               ;;
-       nh3000)
-               basic_machine=m68k-harris
-               os=-cxux
-               ;;
-       nh[45]000)
-               basic_machine=m88k-harris
-               os=-cxux
-               ;;
-       nindy960)
-               basic_machine=i960-intel
-               os=-nindy
-               ;;
-       mon960)
-               basic_machine=i960-intel
-               os=-mon960
-               ;;
-       nonstopux)
-               basic_machine=mips-compaq
-               os=-nonstopux
-               ;;
-       np1)
-               basic_machine=np1-gould
-               ;;
-       nsr-tandem)
-               basic_machine=nsr-tandem
-               ;;
-       op50n-* | op60c-*)
-               basic_machine=hppa1.1-oki
-               os=-proelf
-               ;;
-       openrisc | openrisc-*)
-               basic_machine=or32-unknown
-               ;;
-       os400)
-               basic_machine=powerpc-ibm
-               os=-os400
-               ;;
-       OSE68000 | ose68000)
-               basic_machine=m68000-ericsson
-               os=-ose
-               ;;
-       os68k)
-               basic_machine=m68k-none
-               os=-os68k
-               ;;
-       pa-hitachi)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       paragon)
-               basic_machine=i860-intel
-               os=-osf
-               ;;
-       pbd)
-               basic_machine=sparc-tti
-               ;;
-       pbb)
-               basic_machine=m68k-tti
-               ;;
-       pc532 | pc532-*)
-               basic_machine=ns32k-pc532
-               ;;
-       pentium | p5 | k5 | k6 | nexgen | viac3)
-               basic_machine=i586-pc
-               ;;
-       pentiumpro | p6 | 6x86 | athlon | athlon_*)
-               basic_machine=i686-pc
-               ;;
-       pentiumii | pentium2 | pentiumiii | pentium3)
-               basic_machine=i686-pc
-               ;;
-       pentium4)
-               basic_machine=i786-pc
-               ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumpro-* | p6-* | 6x86-* | athlon-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentium4-*)
-               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pn)
-               basic_machine=pn-gould
-               ;;
-       power)  basic_machine=power-ibm
-               ;;
-       ppc)    basic_machine=powerpc-unknown
-               ;;
-       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppcle | powerpclittle | ppc-le | powerpc-little)
-               basic_machine=powerpcle-unknown
-               ;;
-       ppcle-* | powerpclittle-*)
-               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64)  basic_machine=powerpc64-unknown
-               ;;
-       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-               basic_machine=powerpc64le-unknown
-               ;;
-       ppc64le-* | powerpc64little-*)
-               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ps2)
-               basic_machine=i386-ibm
-               ;;
-       pw32)
-               basic_machine=i586-unknown
-               os=-pw32
-               ;;
-       rom68k)
-               basic_machine=m68k-rom68k
-               os=-coff
-               ;;
-       rm[46]00)
-               basic_machine=mips-siemens
-               ;;
-       rtpc | rtpc-*)
-               basic_machine=romp-ibm
-               ;;
-       s390 | s390-*)
-               basic_machine=s390-ibm
-               ;;
-       s390x | s390x-*)
-               basic_machine=s390x-ibm
-               ;;
-       sa29200)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       sb1)
-               basic_machine=mipsisa64sb1-unknown
-               ;;
-       sb1el)
-               basic_machine=mipsisa64sb1el-unknown
-               ;;
-       sei)
-               basic_machine=mips-sei
-               os=-seiux
-               ;;
-       sequent)
-               basic_machine=i386-sequent
-               ;;
-       sh)
-               basic_machine=sh-hitachi
-               os=-hms
-               ;;
-       sh64)
-               basic_machine=sh64-unknown
-               ;;
-       sparclite-wrs | simso-wrs)
-               basic_machine=sparclite-wrs
-               os=-vxworks
-               ;;
-       sps7)
-               basic_machine=m68k-bull
-               os=-sysv2
-               ;;
-       spur)
-               basic_machine=spur-unknown
-               ;;
-       st2000)
-               basic_machine=m68k-tandem
-               ;;
-       stratus)
-               basic_machine=i860-stratus
-               os=-sysv4
-               ;;
-       sun2)
-               basic_machine=m68000-sun
-               ;;
-       sun2os3)
-               basic_machine=m68000-sun
-               os=-sunos3
-               ;;
-       sun2os4)
-               basic_machine=m68000-sun
-               os=-sunos4
-               ;;
-       sun3os3)
-               basic_machine=m68k-sun
-               os=-sunos3
-               ;;
-       sun3os4)
-               basic_machine=m68k-sun
-               os=-sunos4
-               ;;
-       sun4os3)
-               basic_machine=sparc-sun
-               os=-sunos3
-               ;;
-       sun4os4)
-               basic_machine=sparc-sun
-               os=-sunos4
-               ;;
-       sun4sol2)
-               basic_machine=sparc-sun
-               os=-solaris2
-               ;;
-       sun3 | sun3-*)
-               basic_machine=m68k-sun
-               ;;
-       sun4)
-               basic_machine=sparc-sun
-               ;;
-       sun386 | sun386i | roadrunner)
-               basic_machine=i386-sun
-               ;;
-       sv1)
-               basic_machine=sv1-cray
-               os=-unicos
-               ;;
-       symmetry)
-               basic_machine=i386-sequent
-               os=-dynix
-               ;;
-       t3e)
-               basic_machine=alphaev5-cray
-               os=-unicos
-               ;;
-       t90)
-               basic_machine=t90-cray
-               os=-unicos
-               ;;
-       tic54x | c54x*)
-               basic_machine=tic54x-unknown
-               os=-coff
-               ;;
-       tic55x | c55x*)
-               basic_machine=tic55x-unknown
-               os=-coff
-               ;;
-       tic6x | c6x*)
-               basic_machine=tic6x-unknown
-               os=-coff
-               ;;
-       tx39)
-               basic_machine=mipstx39-unknown
-               ;;
-       tx39el)
-               basic_machine=mipstx39el-unknown
-               ;;
-       toad1)
-               basic_machine=pdp10-xkl
-               os=-tops20
-               ;;
-       tower | tower-32)
-               basic_machine=m68k-ncr
-               ;;
-       tpf)
-               basic_machine=s390x-ibm
-               os=-tpf
-               ;;
-       udi29k)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       ultra3)
-               basic_machine=a29k-nyu
-               os=-sym1
-               ;;
-       v810 | necv810)
-               basic_machine=v810-nec
-               os=-none
-               ;;
-       vaxv)
-               basic_machine=vax-dec
-               os=-sysv
-               ;;
-       vms)
-               basic_machine=vax-dec
-               os=-vms
-               ;;
-       vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
-               ;;
-       vxworks960)
-               basic_machine=i960-wrs
-               os=-vxworks
-               ;;
-       vxworks68)
-               basic_machine=m68k-wrs
-               os=-vxworks
-               ;;
-       vxworks29k)
-               basic_machine=a29k-wrs
-               os=-vxworks
-               ;;
-       w65*)
-               basic_machine=w65-wdc
-               os=-none
-               ;;
-       w89k-*)
-               basic_machine=hppa1.1-winbond
-               os=-proelf
-               ;;
-       xbox)
-               basic_machine=i686-pc
-               os=-mingw32
-               ;;
-       xps | xps100)
-               basic_machine=xps100-honeywell
-               ;;
-       ymp)
-               basic_machine=ymp-cray
-               os=-unicos
-               ;;
-       z8k-*-coff)
-               basic_machine=z8k-unknown
-               os=-sim
-               ;;
-       none)
-               basic_machine=none-none
-               os=-none
-               ;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-       w89k)
-               basic_machine=hppa1.1-winbond
-               ;;
-       op50n)
-               basic_machine=hppa1.1-oki
-               ;;
-       op60c)
-               basic_machine=hppa1.1-oki
-               ;;
-       romp)
-               basic_machine=romp-ibm
-               ;;
-       mmix)
-               basic_machine=mmix-knuth
-               ;;
-       rs6000)
-               basic_machine=rs6000-ibm
-               ;;
-       vax)
-               basic_machine=vax-dec
-               ;;
-       pdp10)
-               # there are many clones, so DEC is not a safe bet
-               basic_machine=pdp10-unknown
-               ;;
-       pdp11)
-               basic_machine=pdp11-dec
-               ;;
-       we32k)
-               basic_machine=we32k-att
-               ;;
-       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
-               basic_machine=sh-unknown
-               ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b)
-               basic_machine=sparc-sun
-               ;;
-       cydra)
-               basic_machine=cydra-cydrome
-               ;;
-       orion)
-               basic_machine=orion-highlevel
-               ;;
-       orion105)
-               basic_machine=clipper-highlevel
-               ;;
-       mac | mpw | mac-mpw)
-               basic_machine=m68k-apple
-               ;;
-       pmac | pmac-mpw)
-               basic_machine=powerpc-apple
-               ;;
-       *-unknown)
-               # Make sure to match an already-canonicalized machine name.
-               ;;
-       *)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
-               ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-       *-digital*)
-               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
-               ;;
-       *-commodore*)
-               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
-               ;;
-       *)
-               ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
-       # -solaris* is a basic system type, with this one exception.
-       -solaris1 | -solaris1.*)
-               os=`echo $os | sed -e 's|solaris1|sunos4|'`
-               ;;
-       -solaris)
-               os=-solaris2
-               ;;
-       -svr4*)
-               os=-sysv4
-               ;;
-       -unixware*)
-               os=-sysv4.2uw
-               ;;
-       -gnu/linux*)
-               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
-               ;;
-       # First accept the basic system types.
-       # The portable systems comes first.
-       # Each alternative MUST END IN A *, to match a version number.
-       # -sysv* is not here because it comes later, after sysvr4.
-       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
-             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* \
-             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
-             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku*)
-       # Remember, each alternative MUST END IN *, to match a version number.
-               ;;
-       -qnx*)
-               case $basic_machine in
-                   x86-* | i*86-*)
-                       ;;
-                   *)
-                       os=-nto$os
-                       ;;
-               esac
-               ;;
-       -nto-qnx*)
-               ;;
-       -nto*)
-               os=`echo $os | sed -e 's|nto|nto-qnx|'`
-               ;;
-       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
-               ;;
-       -mac*)
-               os=`echo $os | sed -e 's|mac|macos|'`
-               ;;
-       -linux-dietlibc)
-               os=-linux-dietlibc
-               ;;
-       -linux*)
-               os=`echo $os | sed -e 's|linux|linux-gnu|'`
-               ;;
-       -sunos5*)
-               os=`echo $os | sed -e 's|sunos5|solaris2|'`
-               ;;
-       -sunos6*)
-               os=`echo $os | sed -e 's|sunos6|solaris3|'`
-               ;;
-       -opened*)
-               os=-openedition
-               ;;
-        -os400*)
-               os=-os400
-               ;;
-       -wince*)
-               os=-wince
-               ;;
-       -osfrose*)
-               os=-osfrose
-               ;;
-       -osf*)
-               os=-osf
-               ;;
-       -utek*)
-               os=-bsd
-               ;;
-       -dynix*)
-               os=-bsd
-               ;;
-       -acis*)
-               os=-aos
-               ;;
-       -atheos*)
-               os=-atheos
-               ;;
-       -syllable*)
-               os=-syllable
-               ;;
-       -386bsd)
-               os=-bsd
-               ;;
-       -ctix* | -uts*)
-               os=-sysv
-               ;;
-       -nova*)
-               os=-rtmk-nova
-               ;;
-       -ns2 )
-               os=-nextstep2
-               ;;
-       -nsk*)
-               os=-nsk
-               ;;
-       # Preserve the version number of sinix5.
-       -sinix5.*)
-               os=`echo $os | sed -e 's|sinix|sysv|'`
-               ;;
-       -sinix*)
-               os=-sysv4
-               ;;
-        -tpf*)
-               os=-tpf
-               ;;
-       -triton*)
-               os=-sysv3
-               ;;
-       -oss*)
-               os=-sysv3
-               ;;
-       -svr4)
-               os=-sysv4
-               ;;
-       -svr3)
-               os=-sysv3
-               ;;
-       -sysvr4)
-               os=-sysv4
-               ;;
-       # This must come after -sysvr4.
-       -sysv*)
-               ;;
-       -ose*)
-               os=-ose
-               ;;
-       -es1800*)
-               os=-ose
-               ;;
-       -xenix)
-               os=-xenix
-               ;;
-       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-               os=-mint
-               ;;
-       -aros*)
-               os=-aros
-               ;;
-       -kaos*)
-               os=-kaos
-               ;;
-       -zvmoe)
-               os=-zvmoe
-               ;;
-       -none)
-               ;;
-       *)
-               # Get rid of the `-' at the beginning of $os.
-               os=`echo $os | sed 's/[^-]*-//'`
-               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
-               exit 1
-               ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system.  Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
-       *-acorn)
-               os=-riscix1.2
-               ;;
-       arm*-rebel)
-               os=-linux
-               ;;
-       arm*-semi)
-               os=-aout
-               ;;
-    c4x-* | tic4x-*)
-        os=-coff
-        ;;
-       # This must come before the *-dec entry.
-       pdp10-*)
-               os=-tops20
-               ;;
-       pdp11-*)
-               os=-none
-               ;;
-       *-dec | vax-*)
-               os=-ultrix4.2
-               ;;
-       m68*-apollo)
-               os=-domain
-               ;;
-       i386-sun)
-               os=-sunos4.0.2
-               ;;
-       m68000-sun)
-               os=-sunos3
-               # This also exists in the configure program, but was not the
-               # default.
-               # os=-sunos4
-               ;;
-       m68*-cisco)
-               os=-aout
-               ;;
-       mips*-cisco)
-               os=-elf
-               ;;
-       mips*-*)
-               os=-elf
-               ;;
-       or32-*)
-               os=-coff
-               ;;
-       *-tti)  # must be before sparc entry or we get the wrong os.
-               os=-sysv3
-               ;;
-       sparc-* | *-sun)
-               os=-sunos4.1.1
-               ;;
-       *-be)
-               os=-beos
-               ;;
-       *-haiku)
-               os=-haiku
-               ;;
-       *-ibm)
-               os=-aix
-               ;;
-       *-knuth)
-               os=-mmixware
-               ;;
-       *-wec)
-               os=-proelf
-               ;;
-       *-winbond)
-               os=-proelf
-               ;;
-       *-oki)
-               os=-proelf
-               ;;
-       *-hp)
-               os=-hpux
-               ;;
-       *-hitachi)
-               os=-hiux
-               ;;
-       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-               os=-sysv
-               ;;
-       *-cbm)
-               os=-amigaos
-               ;;
-       *-dg)
-               os=-dgux
-               ;;
-       *-dolphin)
-               os=-sysv3
-               ;;
-       m68k-ccur)
-               os=-rtu
-               ;;
-       m88k-omron*)
-               os=-luna
-               ;;
-       *-next )
-               os=-nextstep
-               ;;
-       *-sequent)
-               os=-ptx
-               ;;
-       *-crds)
-               os=-unos
-               ;;
-       *-ns)
-               os=-genix
-               ;;
-       i370-*)
-               os=-mvs
-               ;;
-       *-next)
-               os=-nextstep3
-               ;;
-       *-gould)
-               os=-sysv
-               ;;
-       *-highlevel)
-               os=-bsd
-               ;;
-       *-encore)
-               os=-bsd
-               ;;
-       *-sgi)
-               os=-irix
-               ;;
-       *-siemens)
-               os=-sysv4
-               ;;
-       *-masscomp)
-               os=-rtu
-               ;;
-       f30[01]-fujitsu | f700-fujitsu)
-               os=-uxpv
-               ;;
-       *-rom68k)
-               os=-coff
-               ;;
-       *-*bug)
-               os=-coff
-               ;;
-       *-apple)
-               os=-macos
-               ;;
-       *-atari*)
-               os=-mint
-               ;;
-       *)
-               os=-none
-               ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-       *-unknown)
-               case $os in
-                       -riscix*)
-                               vendor=acorn
-                               ;;
-                       -sunos*)
-                               vendor=sun
-                               ;;
-                       -aix*)
-                               vendor=ibm
-                               ;;
-                       -beos*)
-                               vendor=be
-                               ;;
-                       -hpux*)
-                               vendor=hp
-                               ;;
-                       -mpeix*)
-                               vendor=hp
-                               ;;
-                       -hiux*)
-                               vendor=hitachi
-                               ;;
-                       -unos*)
-                               vendor=crds
-                               ;;
-                       -dgux*)
-                               vendor=dg
-                               ;;
-                       -luna*)
-                               vendor=omron
-                               ;;
-                       -genix*)
-                               vendor=ns
-                               ;;
-                       -mvs* | -opened*)
-                               vendor=ibm
-                               ;;
-                       -os400*)
-                               vendor=ibm
-                               ;;
-                       -ptx*)
-                               vendor=sequent
-                               ;;
-                       -tpf*)
-                               vendor=ibm
-                               ;;
-                       -vxsim* | -vxworks* | -windiss*)
-                               vendor=wrs
-                               ;;
-                       -aux*)
-                               vendor=apple
-                               ;;
-                       -hms*)
-                               vendor=hitachi
-                               ;;
-                       -mpw* | -macos*)
-                               vendor=apple
-                               ;;
-                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-                               vendor=atari
-                               ;;
-                       -vos*)
-                               vendor=stratus
-                               ;;
-               esac
-               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
-               ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/source4/cluster/ctdb/configure.ac b/source4/cluster/ctdb/configure.ac
deleted file mode 100644 (file)
index 63ebc28..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-AC_PREREQ(2.50)
-AC_DEFUN([AC_CHECK_LIB_EXT], [
-       AC_CHECK_LIB([$1],[$3],[$4],[$5],[$7])
-       ac_cv_lib_ext_$1_$3=$ac_cv_lib_$1_$3
-])
-AC_DEFUN([AC_CHECK_FUNC_EXT], [
-       AC_CHECK_FUNC([$1],[$3],[$4])
-       ac_cv_func_ext_$1=$ac_cv_func_$1
-])
-AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
-AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
-AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
-AC_DEFUN([SMB_ENABLE], [echo -n ""])
-AC_INIT(ctdb.h)
-AC_CONFIG_SRCDIR([server/ctdbd.c])
-
-case `uname` in
-  Linux*)
-    CTDB_SYSTEM_OBJ=common/system_linux.o
-    CTDB_SCSI_IO=bin/scsi_io
-    CTDB_PCAP_LDFLAGS=
-    ;;
-  AIX*)
-    CTDB_SYSTEM_OBJ=common/system_aix.o
-    CTDB_SCSI_IO=
-    CTDB_PCAP_LDFLAGS=-lpcap
-    ;;
-  *)
-    echo unknown system  cant configure
-    exit
-    ;;
-esac
-
-AC_LIBREPLACE_ALL_CHECKS
-
-if test "$ac_cv_prog_gcc" = yes; then
-   CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
-fi
-
-AC_CONFIG_HEADER(config.h)
-
-EXTRA_OBJ=""
-
-m4_include(libpopt.m4)
-m4_include(libtalloc.m4)
-m4_include(libtdb.m4)
-m4_include(libevents.m4)
-m4_include(ib/config.m4)
-
-AC_CHECK_HEADERS(sched.h)
-AC_CHECK_FUNCS(sched_setscheduler)
-
-AC_CACHE_CHECK([for sin_len in sock],ctdb_cv_HAVE_SOCK_SIN_LEN,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>],
-[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
-ctdb_cv_HAVE_SOCK_SIN_LEN=yes,ctdb_cv_HAVE_SOCK_SIN_LEN=no)])
-if test x"$ctdb_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
-    AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
-fi
-
-AC_SUBST(EXTRA_OBJ)
-AC_SUBST(CTDB_SYSTEM_OBJ)
-AC_SUBST(CTDB_SCSI_IO)
-AC_SUBST(CTDB_PCAP_LDFLAGS)
-
-AC_OUTPUT(Makefile)
diff --git a/source4/cluster/ctdb/ctdb_cluster.c b/source4/cluster/ctdb/ctdb_cluster.c
deleted file mode 100644 (file)
index 9b0c9a8..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-
-   ctdb clustering hooks
-
-   Copyright (C) Andrew Tridgell 2006
-   
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "cluster/cluster.h"
-#include "system/filesys.h"
-#include "cluster/cluster_private.h"
-#include "../tdb/include/tdb.h"
-#include "include/ctdb.h"
-#include "tdb_wrap.h"
-#include "../lib/util/dlinklist.h"
-#include "param/param.h"
-#include "librpc/gen_ndr/server_id.h"
-#include "cluster/ctdb/ctdb_cluster.h"
-
-/* a linked list of messaging handlers, allowing incoming messages
-   to be directed to the right messaging context */
-struct cluster_messaging_list {
-       struct cluster_messaging_list *next, *prev;
-       struct cluster_state *state;
-       struct messaging_context *msg;
-       struct server_id server;
-       cluster_message_fn_t handler;
-};
-
-struct cluster_state {
-       struct ctdb_context *ctdb;
-       struct cluster_messaging_list *list;
-       uint32_t vnn;
-};
-
-
-
-/*
-  return a server_id for a ctdb node
-*/
-static struct server_id ctdb_id(struct cluster_ops *ops, uint64_t id, uint32_t id2)
-{
-       struct cluster_state *state = (struct cluster_state *)ops->private;
-       struct ctdb_context *ctdb = state->ctdb;
-       struct server_id server_id;
-       server_id.node = ctdb_get_vnn(ctdb);
-       server_id.id = id;
-       server_id.id2 = id2;
-       return server_id;
-}
-
-
-/*
-  return a server_id as a string
-*/
-static const char *ctdb_id_string(struct cluster_ops *ops, 
-                                 TALLOC_CTX *mem_ctx, struct server_id id)
-{
-       return talloc_asprintf(mem_ctx, "%u.%llu.%u", id.node, (unsigned long long)id.id, id.id2);
-}
-
-/*
-  this is an interim method for subsystems that have not yet been
-  converted to use the ctdb api. It opens a shared database in the
-  cluster temporary area, using TDB_CLEAR_IF_FIRST which relies on
-  correct operation of fcntl locks on the shared fileystem.
-*/
-static struct tdb_wrap *ctdb_tdb_tmp_open(struct cluster_ops *ops,
-                                         TALLOC_CTX *mem_ctx, 
-                                         struct loadparm_context *lp_ctx,
-                                         const char *dbname, int flags)
-{
-       const char *dir = lp_parm_string(lp_ctx, NULL, "ctdb", "shared data");
-       char *path;
-       struct tdb_wrap *w;
-       if (dir == NULL) {
-               DEBUG(0,("ERROR: You must set 'ctdb:shared data' to a cluster shared path\n"));
-               return NULL;
-       }
-       path = talloc_asprintf(mem_ctx, "%s/%s", dir, dbname);
-       w = tdb_wrap_open(mem_ctx, path, 0,  
-                         flags | TDB_CLEAR_IF_FIRST,
-                         O_RDWR|O_CREAT, 0600);
-       talloc_free(path);
-       return w;
-}
-
-/*
-  get at the ctdb handle
-*/
-static void *ctdb_backend_handle(struct cluster_ops *ops)
-{
-       struct cluster_state *state = (struct cluster_state *)ops->private;
-       return (void *)state->ctdb;
-}
-
-struct ctdb_handler_state {
-       struct cluster_state *state;
-       cluster_message_fn_t handler;
-       struct messaging_context *msg;
-};
-
-/*
-  dispatch incoming ctdb messages
-*/
-static void ctdb_message_handler(struct ctdb_context *ctdb, uint64_t srvid, 
-                                TDB_DATA data, void *private)
-{
-       struct ctdb_handler_state *s = talloc_get_type(private, 
-                                                      struct ctdb_handler_state);
-       DATA_BLOB blob;
-       blob.data&nbs