ACK On 1/14/2012 10:13 PM, Steven Dake wrote: > Signed-off-by: Steven Dake <sdake@xxxxxxxxxx> > --- > Makefile.am | 4 +- > configure.ac | 13 - > corosync.spec.in | 22 -- > exec/apidef.c | 1 - > exec/coroparse.c | 1 - > exec/evil.c | 1 - > exec/service.c | 1 - > exec/sync.c | 1 - > exec/syncv2.c | 1 - > exec/vsf_quorum.c | 2 - > include/Makefile.am | 4 +- > include/corosync/cs_config.h.in | 3 - > include/corosync/lcr/lcr_ckpt.h | 58 ---- > include/corosync/lcr/lcr_comp.h | 64 ---- > include/corosync/lcr/lcr_ifact.h | 58 ---- > lcr/.gitignore | 3 - > lcr/Makefile.am | 79 ----- > lcr/README.lcr | 113 -------- > lcr/lcr_ifact.c | 590 -------------------------------------- > lcr/libtest_a.c | 166 ----------- > lcr/libtest_b.c | 174 ----------- > lcr/test.c | 129 --------- > lcr/uic.c | 157 ---------- > lcr/uis.c | 205 ------------- > lib/Makefile.am | 3 - > loc | 3 - > pkgconfig/corosync.pc.in | 1 - > tools/Makefile.am | 4 +- > 28 files changed, 5 insertions(+), 1856 deletions(-) > delete mode 100644 include/corosync/lcr/lcr_ckpt.h > delete mode 100644 include/corosync/lcr/lcr_comp.h > delete mode 100644 include/corosync/lcr/lcr_ifact.h > delete mode 100644 lcr/.gitignore > delete mode 100644 lcr/Makefile.am > delete mode 100644 lcr/README.lcr > delete mode 100644 lcr/lcr_ifact.c > delete mode 100644 lcr/libtest_a.c > delete mode 100644 lcr/libtest_b.c > delete mode 100644 lcr/test.c > delete mode 100755 lcr/uic.c > delete mode 100755 lcr/uis.c > > diff --git a/Makefile.am b/Makefile.am > index fae829f..5b882a7 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -71,7 +71,7 @@ corosysxmlxsltdir = ${datadir}/corosync > corosysxmlxslt_DATA = conf/xml2conf.xsl > endif > > -SUBDIRS = include lcr lib exec tools test cts pkgconfig \ > +SUBDIRS = include lib exec tools test cts pkgconfig \ > man init conf > > coverity: > @@ -104,7 +104,7 @@ test_lense.sh: > endif > > lint: > - for dir in lcr lib exec tools test; do make -C $$dir lint; done > + for dir in lib exec tools test; do make -C $$dir lint; done > > .PHONY: doxygen > doxygen: > diff --git a/configure.ac b/configure.ac > index 6226f2b..d03c91b 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -130,7 +130,6 @@ AC_CONFIG_FILES([Makefile > exec/Makefile > include/Makefile > init/Makefile > - lcr/Makefile > lib/Makefile > man/Makefile > pkgconfig/Makefile > @@ -289,11 +288,6 @@ AC_ARG_WITH([initddir], > [ INITDDIR="$withval" ], > [ INITDDIR="$sysconfdir/init.d" ]) > > -AC_ARG_WITH([lcrso-dir], > - [ --with-lcrso-dir=DIR : corosync lcrso files. ], > - [ LCRSODIR="$withval" ], > - [ LCRSODIR="$libexecdir/lcrso" ]) > - > AC_ARG_WITH([socket-dir], > [ --with-socket-dir=DIR : corosync socket dir. ], > [ SOCKETDIR="$withval" ], > @@ -516,7 +510,6 @@ else > enable_snmp=0 > fi > AC_SUBST([SNMPLIBS]) > -AC_SUBST([SNMP_LCRSO]) > AM_CONDITIONAL(BUILD_SNMP, test "${enable_snmp}" = "1") > > # extra warnings > @@ -556,12 +549,10 @@ if test "x${enable_coverage}" = xyes && \ > OPT_CFLAGS="-O0" > COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs" > COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" > - COVERAGE_LCRSO_EXTRA_LDFLAGS="-rdynamic" > PACKAGE_FEATURES="$PACKAGE_FEATURES coverage" > else > COVERAGE_CFLAGS="" > COVERAGE_LDFLAGS="" > - COVERAGE_LCRSO_EXTRA_LDFLAGS="" > fi > > > @@ -603,14 +594,12 @@ LDFLAGS="$ENV_LDFLAGS $COVERAGE_LDFLAGS $OS_LDFLAGS" > > # substitute what we need: > AC_SUBST([INITDDIR]) > -AC_SUBST([LCRSODIR]) > AC_SUBST([SOCKETDIR]) > > AC_SUBST([SOMAJOR]) > AC_SUBST([SOMINOR]) > AC_SUBST([SOMICRO]) > AC_SUBST([SONAME]) > -AC_SUBST([COVERAGE_LCRSO_EXTRA_LDFLAGS]) > AC_SUBST([OS_DYFLAGS]) > > AC_SUBST([OS_LDL]) > @@ -629,7 +618,6 @@ AM_CONDITIONAL(BUILD_HTML_DOCS, test -n "${GROFF}") > > AC_SUBST([LINT_FLAGS]) > > -AC_DEFINE_UNQUOTED([LCRSODIR], "$(eval echo ${LCRSODIR})", [LCRSO directory]) > AC_DEFINE_UNQUOTED([SOCKETDIR], "$(eval echo ${SOCKETDIR})", [Socket directory]) > AC_DEFINE_UNQUOTED([LOCALSTATEDIR], "$(eval echo ${localstatedir})", [localstate directory]) > > @@ -655,7 +643,6 @@ AC_MSG_RESULT([ State information = ${localstatedir}]) > AC_MSG_RESULT([ System configuration = ${sysconfdir}]) > AC_MSG_RESULT([ System init.d directory = ${INITDDIR}]) > AC_MSG_RESULT([ corosync config dir = ${COROSYSCONFDIR}]) > -AC_MSG_RESULT([ LCRSO = ${LCRSODIR}]) > AC_MSG_RESULT([ SOCKETDIR = ${SOCKETDIR}]) > AC_MSG_RESULT([ Features =${PACKAGE_FEATURES}]) > AC_MSG_RESULT([]) > diff --git a/corosync.spec.in b/corosync.spec.in > index 08b005f..58603ca 100644 > --- a/corosync.spec.in > +++ b/corosync.spec.in > @@ -173,23 +173,6 @@ fi > %{_initrddir}/corosync > %{_initrddir}/corosync-notifyd > %endif > -%dir %{_libexecdir}/lcrso > -%{_libexecdir}/lcrso/coroparse.lcrso > -%{_libexecdir}/lcrso/service_cfg.lcrso > -%{_libexecdir}/lcrso/service_cpg.lcrso > -%{_libexecdir}/lcrso/service_evs.lcrso > -%{_libexecdir}/lcrso/service_cmap.lcrso > -%{_libexecdir}/lcrso/service_pload.lcrso > -%{_libexecdir}/lcrso/quorum_votequorum.lcrso > -%{_libexecdir}/lcrso/quorum_testquorum.lcrso > -%{_libexecdir}/lcrso/vsf_quorum.lcrso > -%{_libexecdir}/lcrso/vsf_ykd.lcrso > -%if %{with watchdog} > -%{_libexecdir}/lcrso/service_wd.lcrso > -%endif > -%if %{with monitoring} > -%{_libexecdir}/lcrso/service_mon.lcrso > -%endif > %dir %{_localstatedir}/lib/corosync > %dir %{_localstatedir}/log/cluster > %{_mandir}/man8/corosync_overview.8* > @@ -225,7 +208,6 @@ This package contains corosync test agents. > %{_bindir}/cpg_test_agent > %{_bindir}/sam_test_agent > %{_bindir}/votequorum_test_agent > -%{_libexecdir}/lcrso/service_syncv2.lcrso > > %endif > > @@ -290,10 +272,6 @@ The Corosync Cluster Engine APIs. > %{_includedir}/corosync/totem/totem.h > %{_includedir}/corosync/totem/totemip.h > %{_includedir}/corosync/totem/totempg.h > -%dir %{_includedir}/corosync/lcr/ > -%{_includedir}/corosync/lcr/lcr_ckpt.h > -%{_includedir}/corosync/lcr/lcr_comp.h > -%{_includedir}/corosync/lcr/lcr_ifact.h > %dir %{_includedir}/corosync/engine > %{_includedir}/corosync/engine/config.h > %{_includedir}/corosync/engine/quorum.h > diff --git a/exec/apidef.c b/exec/apidef.c > index 24fa5b9..8721996 100644 > --- a/exec/apidef.c > +++ b/exec/apidef.c > @@ -42,7 +42,6 @@ > #include <qb/qbipcs.h> > > #include <corosync/corotypes.h> > -#include <corosync/lcr/lcr_ifact.h> > #include <corosync/totem/totempg.h> > #include <corosync/totem/totemip.h> > #include <corosync/totem/totem.h> > diff --git a/exec/coroparse.c b/exec/coroparse.c > index d1c8ae4..a095612 100644 > --- a/exec/coroparse.c > +++ b/exec/coroparse.c > @@ -55,7 +55,6 @@ > #include <pwd.h> > > #include <corosync/list.h> > -#include <corosync/lcr/lcr_comp.h> > #include <qb/qbutil.h> > #define LOGSYS_UTILS_ONLY 1 > #include <corosync/logsys.h> > diff --git a/exec/evil.c b/exec/evil.c > index 092f55d..b22a034 100644 > --- a/exec/evil.c > +++ b/exec/evil.c > @@ -69,7 +69,6 @@ > #include <corosync/corotypes.h> > #include <corosync/corodefs.h> > #include <corosync/list.h> > -#include <corosync/lcr/lcr_ifact.h> > #include <corosync/config.h> > #include <corosync/coroapi.h> > #include <corosync/logsys.h> > diff --git a/exec/service.c b/exec/service.c > index 8f701eb..5bd35d2 100644 > --- a/exec/service.c > +++ b/exec/service.c > @@ -38,7 +38,6 @@ > #include <stdlib.h> > #include <string.h> > > -#include <corosync/lcr/lcr_ifact.h> > #include <corosync/swab.h> > #include <corosync/totem/totem.h> > > diff --git a/exec/sync.c b/exec/sync.c > index 0cf01b3..f84c402 100644 > --- a/exec/sync.c > +++ b/exec/sync.c > @@ -54,7 +54,6 @@ > #include <corosync/swab.h> > #include <corosync/totem/totempg.h> > #include <corosync/totem/totem.h> > -#include <corosync/lcr/lcr_ifact.h> > #include <corosync/logsys.h> > #include <qb/qbipc_common.h> > #include "quorum.h" > diff --git a/exec/syncv2.c b/exec/syncv2.c > index a278be8..5a5528e 100644 > --- a/exec/syncv2.c > +++ b/exec/syncv2.c > @@ -53,7 +53,6 @@ > #include <corosync/swab.h> > #include <corosync/totem/totempg.h> > #include <corosync/totem/totem.h> > -#include <corosync/lcr/lcr_ifact.h> > #include <corosync/logsys.h> > #include <qb/qbipc_common.h> > #include "schedwrk.h" > diff --git a/exec/vsf_quorum.c b/exec/vsf_quorum.c > index c59afb9..bef65fd 100644 > --- a/exec/vsf_quorum.c > +++ b/exec/vsf_quorum.c > @@ -61,8 +61,6 @@ > #include <corosync/list.h> > #include <corosync/mar_gen.h> > #include <corosync/ipc_quorum.h> > -#include <corosync/lcr/lcr_comp.h> > -#include <corosync/lcr/lcr_ifact.h> > #include <corosync/mar_gen.h> > #include <corosync/coroapi.h> > #include <corosync/logsys.h> > diff --git a/include/Makefile.am b/include/Makefile.am > index a8f3477..b08341f 100644 > --- a/include/Makefile.am > +++ b/include/Makefile.am > @@ -39,8 +39,6 @@ CS_INTERNAL_H = ipc_cfg.h ipc_cpg.h ipc_evs.h ipc_pload.h ipc_quorum.h \ > jhash.h pload.h quorum.h sq.h ipc_votequorum.h ipc_cmap.h \ > logsys.h coroapi.h icmap.h > > -LCR_H = lcr_ckpt.h lcr_comp.h lcr_ifact.h > - > ENGINE_H = config.h quorum.h > > TOTEM_H = totem.h totemip.h totempg.h > @@ -49,5 +47,5 @@ EXTRA_DIST = $(noinst_HEADERS) > > noinst_HEADERS = $(CS_INTERNAL_H:%=corosync/%) > > -nobase_include_HEADERS = $(CS_H:%=corosync/%) $(LCR_H:%=corosync/lcr/%) \ > +nobase_include_HEADERS = $(CS_H:%=corosync/%) \ > $(ENGINE_H:%=corosync/engine/%) $(TOTEM_H:%=corosync/totem/%) > diff --git a/include/corosync/cs_config.h.in b/include/corosync/cs_config.h.in > index 39922be..37f7212 100644 > --- a/include/corosync/cs_config.h.in > +++ b/include/corosync/cs_config.h.in > @@ -1,5 +1,2 @@ > -/* Location of lcrso plugins */ > -#undef LCRSODIR > - > /* Location of sockets */ > #undef SOCKETDIR > diff --git a/include/corosync/lcr/lcr_ckpt.h b/include/corosync/lcr/lcr_ckpt.h > deleted file mode 100644 > index 7d3ba4d..0000000 > --- a/include/corosync/lcr/lcr_ckpt.h > +++ /dev/null > @@ -1,58 +0,0 @@ > -/* > - * Copyright (C) 2006 Steven Dake (sdake@xxxxxxxxxx) > - * > - * This software licensed under BSD license, the text of which follows: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions are met: > - * > - * - Redistributions of source code must retain the above copyright notice, > - * this list of conditions and the following disclaimer. > - * - Redistributions in binary form must reproduce the above copyright notice, > - * this list of conditions and the following disclaimer in the documentation > - * and/or other materials provided with the distribution. > - * - Neither the name of the MontaVista Software, Inc. nor the names of its > - * contributors may be used to endorse or promote products derived from this > - * software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > - * THE POSSIBILITY OF SUCH DAMAGE. > - */ > - > -#ifndef LCR_CKPT_H_DEFINED > -#define LCR_CKPT_H_DEFINED > - > -/** > - * Write data of length data_len into the section name for ckpt_handle > - */ > -int lcr_ckpt_section_write (void *ckpt_handle, const char *name, > - const void *data, size_t data_len); > - > -/** > - * Read the section name into data with data len. > - * > - * @retval Returned in data_len is the actual data read from ckpt_handle. > - */ > -int lcr_ckpt_section_read (void *ckpt_handle, const char *name, > - void *data, size_t *data_len); > - > -/** > - * Initialize the section iterator to the first section > - */ > -int lcr_ckpt_section_iterator_first (void *ckpt_handle); > - > -/** > - * Get the current section, return it in name, and advance to next section > - */ > -int lcr_ckpt_section_iterator_next (void *ckpt_handle, char **name); > - > -#endif /* LCR_CKPT_H_DEFINED */ > diff --git a/include/corosync/lcr/lcr_comp.h b/include/corosync/lcr/lcr_comp.h > deleted file mode 100644 > index f163cbf..0000000 > --- a/include/corosync/lcr/lcr_comp.h > +++ /dev/null > @@ -1,64 +0,0 @@ > -/* > - * Copyright (C) 2006 Steven Dake (sdake@xxxxxxxxxx) > - * > - * This software licensed under BSD license, the text of which follows: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions are met: > - * > - * - Redistributions of source code must retain the above copyright notice, > - * this list of conditions and the following disclaimer. > - * - Redistributions in binary form must reproduce the above copyright notice, > - * this list of conditions and the following disclaimer in the documentation > - * and/or other materials provided with the distribution. > - * - Neither the name of the MontaVista Software, Inc. nor the names of its > - * contributors may be used to endorse or promote products derived from this > - * software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > - * THE POSSIBILITY OF SUCH DAMAGE. > - */ > - > -#ifndef LCR_COMP_H_DEFINED > -#define LCR_COMP_H_DEFINED > - > -/** > - * LCR Interface > - */ > -struct lcr_iface { > - const char *name; /**< Name of the interface */ > - int version; /**< Version of this interface */ > - int *versions_replace; /**< Versions that this interface can replace */ > - int versions_replace_count; /**< Count of entries in version_replace */ > - char **dependencies; /**< Dependent interfaces */ > - size_t dependency_count; /**< Count of entires in dependencies */ > - int (*constructor) (void *context); /**< Constructor for this interface */ > - void (*destructor) (void *context); /**< Constructor for this interface */ > - void **interfaces; /**< List of functions in interface */ > -}; > - > -/** > - * LCR Component > - */ > -struct lcr_comp { > - struct lcr_iface *ifaces; /**< List of interfaces in this component */ > - size_t iface_count; /**< size of ifaces list */ > -}; > - > -extern void lcr_component_register (struct lcr_comp *comp); > - > -static inline void lcr_interfaces_set (struct lcr_iface *iface, void *iface_list) > -{ > - iface->interfaces = (void **)iface_list; > -} > - > -#endif /* LCR_COMP_H_DEFINED */ > diff --git a/include/corosync/lcr/lcr_ifact.h b/include/corosync/lcr/lcr_ifact.h > deleted file mode 100644 > index 446e1af..0000000 > --- a/include/corosync/lcr/lcr_ifact.h > +++ /dev/null > @@ -1,58 +0,0 @@ > -/* > - * Copyright (C) 2006 Steven Dake (sdake@xxxxxxxxxx) > - * > - * This software licensed under BSD license, the text of which follows: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions are met: > - * > - * - Redistributions of source code must retain the above copyright notice, > - * this list of conditions and the following disclaimer. > - * - Redistributions in binary form must reproduce the above copyright notice, > - * this list of conditions and the following disclaimer in the documentation > - * and/or other materials provided with the distribution. > - * - Neither the name of the MontaVista Software, Inc. nor the names of its > - * contributors may be used to endorse or promote products derived from this > - * software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > - * THE POSSIBILITY OF SUCH DAMAGE. > - */ > - > -#ifndef LCR_IFACT_H_DEFINED > -#define LCR_IFACT_H_DEFINED > - > -#include <corosync/hdb.h> > - > -#ifdef __cplusplus > -extern "C" { > -#endif > - > -int lcr_ifact_reference ( > - hdb_handle_t *handle, > - const char *iface_name, > - int version, > - void **interface, > - void *context); > - > -void *lcr_ifact_addr_get(hdb_handle_t iface_handle, > - const char* symbol_name); > - > -int lcr_ifact_release ( > - hdb_handle_t handle); > - > - > -#ifdef __cplusplus > -} > -#endif > - > -#endif /* LCR_IFACT_H_DEFINED */ > diff --git a/lcr/.gitignore b/lcr/.gitignore > deleted file mode 100644 > index aafc88c..0000000 > --- a/lcr/.gitignore > +++ /dev/null > @@ -1,3 +0,0 @@ > -test > -test_static > -uic > diff --git a/lcr/Makefile.am b/lcr/Makefile.am > deleted file mode 100644 > index 9c2434e..0000000 > --- a/lcr/Makefile.am > +++ /dev/null > @@ -1,79 +0,0 @@ > -# Copyright (c) 2009 Red Hat, Inc. > -# > -# Authors: Andrew Beekhof > -# Steven Dake (sdake@xxxxxxxxxx) > -# > -# This software licensed under BSD license, the text of which follows: > -# > -# Redistribution and use in source and binary forms, with or without > -# modification, are permitted provided that the following conditions are met: > -# > -# - Redistributions of source code must retain the above copyright notice, > -# this list of conditions and the following disclaimer. > -# - Redistributions in binary form must reproduce the above copyright notice, > -# this list of conditions and the following disclaimer in the documentation > -# and/or other materials provided with the distribution. > -# - Neither the name of the MontaVista Software, Inc. nor the names of its > -# contributors may be used to endorse or promote products derived from this > -# software without specific prior written permission. > -# > -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > -# THE POSSIBILITY OF SUCH DAMAGE. > -MAINTAINERCLEANFILES = Makefile.in > - > -AM_CFLAGS = -fPIC > - > -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include > - > -lib_LIBRARIES = liblcr.a > - > -noinst_PROGRAMS = test test_static uic > - > -noinst_LCRSO = libtest_a.lcrso libtest_b.lcrso > - > -uic_SOURCES = uic.c > - > -liblcr_a_SOURCES = lcr_ifact.c > - > -test_SOURCES = test.c uis.c > -test_LDADD = liblcr.a $(LIBQB_LIBS) > - > -test_static_SOURCES = test.c libtest_a.c libtest_b.c uis.c lcr_ifact.c > -test_static_LDADD = $(LIBQB_LIBS) > - > -if BUILD_DARWIN > - > -%.lcrso: %.o > - $(CC) $(LDFLAGS) $(CFLAGS) -bundle -bundle_loader ./test $^ -o $@ > -else > - > -if BUILD_SOLARIS > - > -%.lcrso: %.o > - $(CC) $(LDFLAGS) $(CFLAGS) -shared $^ -o $@ > -else > - > -%.lcrso: %.o > - $(CC) $(LDFLAGS) $(CFLAGS) -shared -Wl,-soname,$@ $^ -o $@ > - > -endif > - > -endif > - > -lint: > - -splint $(LINT_FLAGS) $(CFLAGS) *.c > - > -all-local: $(noinst_LCRSO) > - @echo Built Live Component Replacement System > - > -clean-local: > - rm -f *.o *.a *.so* *.da *.bb *.bbg *.lcrso > diff --git a/lcr/README.lcr b/lcr/README.lcr > deleted file mode 100644 > index ad782d0..0000000 > --- a/lcr/README.lcr > +++ /dev/null > @@ -1,113 +0,0 @@ > -Live Component Replacement > --------------------------- > -All software is composed of components, which contain multiple software classes. > -Components generally depend upon other components and sometimes classes from > -other components. > - > -Some components of corosync are the evt service, the ckpt service, the clm > -service, the totem protocol, and others. If a defect is found in any of > -these components, the entire ais executive must be stopped, replaced, and > -restarted. > - > -The lcr code formalizes the concept of components into dynamic libraries. A > -component may have multiple classes. Each class (the lcr code uses the word > -interface) may have multiple functions within the class. Each interface may > -depend upon other interfaces, and those interfaces are then loaded prior to the > -requested interface being referenced. > - > -Note that with recent changes, the lcr interface factory can be used when > -statically linking without additional steps. The interface for notifying > -lcr of a component has changed. > - > -A list of shared objects is scanned each time an interface is requested to > -load via the following interface: > - > -int lcr_ifact_reference ( > - void **handle, > - char *iface_name, > - int version, > - void **interface, > - void *context); > - > -The iface_name is the name of the interface, the version is the version, > -the void **interface is the list of functions returned once the interface > -has been dynamically loaded and referenced, and context is passed to the > -constructor and destructor. > - > -The interface is loaded, the interface constructor is called, and the list > -of interfaces is returned back to the caller. > - > -First the list of interfaces is described in an iface_list data structure: > -struct iface_list iface_list = { > - .iface1_func1 = iface1_func1, > - .iface1_func2 = iface1_func2, > - .iface1_func3 = iface1_func3, > -}; > -iface1_func1 is a simple function call. > - > -Then the lcr_iface data structure is defined for the c file: > - > -struct lcr_iface iface1_ver0 = { > - .name = "iface1", > - .version = 0, > - .versions_replace = 0, > - .versions_replace_count = 0, > - .dependencies = 0, > - .dependency_count = 0, > - .constructor = iface1_constructor, > - .destructor = iface1_destructor, > - .interfaces = (void **)&iface_list, > -}; > - > -The name and version fields provide naming and versioning. The constructor > -and destructor functions execute at reference and release times. Finally > -the .interfaces type describes the list of functions used for the interface. > - > -Next, an lcr_comp must be described: > - > -struct lcr_comp test_comp = { > - .iface_count = 2, > - .ifaces = lcr_ifaces > -}; > - > -the iface count describes the number of interfaces within the component, > -and lcr_ifaces is an array of pointers to lcr_iface data types. > - > -The lcr_comp_get method has been replaced. The final step is to setup a > -constructor that is started when the task is started. This ctor will > -register the component with the lcr framework. > - > -static void register_this_component (void) { > - lcr_component_register (&test_comp); > -} > - > -static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component }; > - > - > -Now the component can be referenced and used in another application. > -int main () > -{ > - > -..... > - > - lcr_ifact_reference ( > - &ifact_handle_ver0, > - "iface1", > - 0, /* version 0 */ > - (void **)&iface_ver0, > - (void *)0xdeadbeef); > - > - iface_ver0->func1(); > - iface_ver0->func2(); > - iface_ver0->func3(); > -} > - > - > -See libtest_a and libtest_b for two sample components. The test program > -demonstrates usage. The test_static demonstrates operation when statically > -linked. Note the dynamic inteface factory is still available for use when > -statically linking components. > - > -On startup, a thread is created which listens for requests from the "uic" > -application. These requests are then processed by the lcr service which > -would execute a live replacement. > diff --git a/lcr/lcr_ifact.c b/lcr/lcr_ifact.c > deleted file mode 100644 > index fc14f8c..0000000 > --- a/lcr/lcr_ifact.c > +++ /dev/null > @@ -1,590 +0,0 @@ > -/* > - * Copyright (C) 2006 Steven Dake (sdake@xxxxxxxxxx) > - * > - * This software licensed under BSD license, the text of which follows: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions are met: > - * > - * - Redistributions of source code must retain the above copyright notice, > - * this list of conditions and the following disclaimer. > - * - Redistributions in binary form must reproduce the above copyright notice, > - * this list of conditions and the following disclaimer in the documentation > - * and/or other materials provided with the distribution. > - * - Neither the name of the MontaVista Software, Inc. nor the names of its > - * contributors may be used to endorse or promote products derived from this > - * software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > - * THE POSSIBILITY OF SUCH DAMAGE. > - */ > - > -#include <config.h> > - > -#include <stdio.h> > -#include <stdlib.h> > -#include <dlfcn.h> > -#include <dirent.h> > -#include <errno.h> > -#include <string.h> > -#include <unistd.h> > -#include <fnmatch.h> > -#ifdef COROSYNC_SOLARIS > -#include <iso/limits_iso.h> > -#endif > -#include <corosync/hdb.h> > -#include <corosync/lcr/lcr_comp.h> > -#include <corosync/lcr/lcr_ifact.h> > - > -struct lcr_component_instance { > - struct lcr_iface *ifaces; > - int iface_count; > - hdb_handle_t comp_handle; > - void *dl_handle; > - int refcount; > - char library_name[256]; > -}; > - > -struct lcr_iface_instance { > - hdb_handle_t component_handle; > - void *context; > - void (*destructor) (void *context); > -}; > - > -DECLARE_HDB_DATABASE (lcr_component_instance_database, NULL); > - > -DECLARE_HDB_DATABASE (lcr_iface_instance_database, NULL); > - > -/* > -static struct hdb_handle_database lcr_component_instance_database = { > - .handle_count = 0, > - .handles = 0, > - .iterator = 0 > -}; > - > -static struct hdb_handle_database lcr_iface_instance_database = { > - .handle_count = 0, > - .handles = 0, > - .iterator = 0 > -}; > -*/ > - > -static hdb_handle_t g_component_handle = 0xFFFFFFFF; > - > -#if defined(COROSYNC_LINUX) || defined(COROSYNC_SOLARIS) > -static int lcr_select_so (const struct dirent *dirent) > -#else > -static int lcr_select_so (struct dirent *dirent) > -#endif > -{ > - unsigned int len; > - > - len = strlen (dirent->d_name); > - > - if (len > 6) { > - if (strcmp (".lcrso", dirent->d_name + len - 6) == 0) { > - return (1); > - } > - } > - return (0); > -} > - > -#if defined(COROSYNC_LINUX) || defined(COROSYNC_SOLARIS) > -static int pathlist_select (const struct dirent *dirent) > -#else > -static int pathlist_select (struct dirent *dirent) > -#endif > -{ > - if (fnmatch ("*.conf", dirent->d_name, 0) == 0) { > - return (1); > - } > - > - return (0); > -} > - > -static inline struct lcr_component_instance *lcr_comp_find ( > - const char *iface_name, > - unsigned int version, > - unsigned int *iface_number) > -{ > - struct lcr_component_instance *instance; > - void *instance_p = NULL; > - hdb_handle_t component_handle = 0; > - int i; > - > - /* > - * Try to find interface in already loaded component > - */ > - hdb_iterator_reset (&lcr_component_instance_database); > - while (hdb_iterator_next (&lcr_component_instance_database, > - &instance_p, &component_handle) == 0) { > - > - instance = (struct lcr_component_instance *)instance_p; > - > - for (i = 0; i < instance->iface_count; i++) { > - if ((strcmp (instance->ifaces[i].name, iface_name) == 0) && > - instance->ifaces[i].version == version) { > - > - *iface_number = i; > - return (instance); > - } > - } > - hdb_handle_put (&lcr_component_instance_database, component_handle); > - } > - > - return (NULL); > -} > - > -static inline int lcr_lib_loaded ( > - char *library_name) > -{ > - struct lcr_component_instance *instance; > - void *instance_p = NULL; > - hdb_handle_t component_handle = 0; > - > - /* > - * Try to find interface in already loaded component > - */ > - hdb_iterator_reset (&lcr_component_instance_database); > - while (hdb_iterator_next (&lcr_component_instance_database, > - (void *)&instance_p, &component_handle) == 0) { > - > - instance = (struct lcr_component_instance *)instance_p; > - > - if (strcmp (instance->library_name, library_name) == 0) { > - return (1); > - } > - > - hdb_handle_put (&lcr_component_instance_database, component_handle); > - } > - > - return (0); > -} > - > -enum { PATH_LIST_SIZE = 128 }; > -const char *path_list[PATH_LIST_SIZE]; > -unsigned int path_list_entries = 0; > - > -static void defaults_path_build (void) > -{ > - char cwd[1024]; > - char *res; > - > - res = getcwd (cwd, sizeof (cwd)); > - if (res != NULL && (path_list[0] = strdup (cwd)) != NULL) { > - path_list_entries++; > - } > - > - path_list[path_list_entries++] = LCRSODIR; > -} > - > -static void ld_library_path_build (void) > -{ > - char *ld_library_path; > - char *my_ld_library_path; > - char *p_s, *ptrptr; > - > - ld_library_path = getenv ("LD_LIBRARY_PATH"); > - if (ld_library_path == NULL) { > - return; > - } > - my_ld_library_path = strdup (ld_library_path); > - if (my_ld_library_path == NULL) { > - return; > - } > - > - p_s = strtok_r (my_ld_library_path, ":", &ptrptr); > - while (p_s != NULL) { > - char *p = strdup (p_s); > - if (p && path_list_entries < PATH_LIST_SIZE) { > - path_list[path_list_entries++] = p; > - } > - p_s = strtok_r (NULL, ":", &ptrptr); > - } > - > - free (my_ld_library_path); > -} > - > -static int ldso_path_build (const char *path, const char *filename) > -{ > - FILE *fp; > - char string[1024]; > - char filename_cat[1024]; > - char newpath[1024]; > - char *newpath_tmp; > - char *new_filename; > - int j; > - struct dirent **scandir_list; > - unsigned int scandir_entries; > - > - snprintf (filename_cat, sizeof(filename_cat), "%s/%s", path, filename); > - if (filename[0] == '*') { > - scandir_entries = scandir ( > - path, > - &scandir_list, > - pathlist_select, alphasort); > - if (scandir_entries == 0) { > - return 0; > - } else if (scandir_entries == -1) { > - return -1; > - } else { > - for (j = 0; j < scandir_entries; j++) { > - ldso_path_build (path, scandir_list[j]->d_name); > - } > - } > - } > - > - fp = fopen (filename_cat, "r"); > - if (fp == NULL) { > - return (-1); > - } > - > - while (fgets (string, sizeof (string), fp)) { > - char *p; > - if (strlen(string) > 0) > - string[strlen(string) - 1] = '\0'; > - if (strncmp (string, "include", strlen ("include")) == 0) { > - newpath_tmp = string + strlen ("include") + 1; > - for (j = strlen (string); > - string[j] != ' ' && > - string[j] != '/' && > - j > 0; > - j--) { > - } > - string[j] = '\0'; > - new_filename = &string[j] + 1; > - strcpy (newpath, path); > - strcat (newpath, "/"); > - strcat (newpath, newpath_tmp); > - ldso_path_build (newpath, new_filename); > - continue; > - } > - p = strdup (string); > - if (p && path_list_entries < PATH_LIST_SIZE) { > - path_list[path_list_entries++] = p; > - } > - } > - fclose(fp); > - return (0); > -} > - > -#if defined (COROSYNC_SOLARIS) && !defined(HAVE_SCANDIR) > -static int scandir ( > - const char *dir, struct dirent ***namelist, > - int (*filter)(const struct dirent *), > - int (*compar)(const struct dirent **, const struct dirent **)) > -{ > - DIR *d; > - struct dirent *entry; > - struct dirent *result; > - struct dirent **names = NULL; > - int namelist_items = 0, namelist_size = 0; > - size_t len; > - int return_code; > - > - d = opendir(dir); > - if (d == NULL) > - return -1; > - > - names = NULL; > - > - len = offsetof(struct dirent, d_name) + > - pathconf(dir, _PC_NAME_MAX) + 1; > - entry = malloc(len); > - > - for (return_code = readdir_r (d, entry, &result); > - dirent != NULL && return_code == 0; > - return_code = readdir_r(d, entry, &result)) { > - > - struct dirent *tmpentry; > - if ((filter != NULL) && ((*filter)(result) == 0)) { > - continue; > - } > - if (namelist_items >= namelist_size) { > - struct dirent **tmp; > - namelist_size += 512; > - if ((unsigned long)namelist_size > INT_MAX) { > - errno = EOVERFLOW; > - goto fail; > - } > - tmp = realloc (names, > - namelist_size * sizeof(struct dirent *)); > - if (tmp == NULL) { > - goto fail; > - } > - names = tmp; > - } > - tmpentry = malloc (result->d_reclen); > - if (tmpentry == NULL) { > - goto fail; > - } > - (void) memcpy (tmpentry, result, result->d_reclen); > - names[namelist_items++] = tmpentry; > - } > - (void) closedir (d); > - if ((namelist_items > 1) && (compar != NULL)) { > - qsort (names, namelist_items, sizeof (struct dirent *), > - (int (*)(const void *, const void *))compar); > - } > - > - *namelist = names; > - > - return namelist_items; > - > -fail: > - { > - int err = errno; > - (void) closedir (d); > - while (namelist_items != 0) { > - namelist_items--; > - free (*namelist[namelist_items]); > - } > - free (entry); > - free (names); > - *namelist = NULL; > - errno = err; > - return -1; > - } > -} > -#endif > - > -#if defined (COROSYNC_SOLARIS) && !defined(HAVE_ALPHASORT) > -static int alphasort (const struct dirent **a, const struct dirent **b) > -{ > - return strcmp ((*a)->d_name, (*b)->d_name); > -} > -#endif > - > -static int interface_find_and_load ( > - const char *path, > - const char *iface_name, > - int version, > - struct lcr_component_instance **instance_ret, > - unsigned int *iface_number) > -{ > - struct lcr_component_instance *instance; > - void *dl_handle; > - struct dirent **scandir_list; > - int scandir_entries; > - unsigned int libs_to_scan; > - char dl_name[1024]; > -#ifdef COROSYNC_SOLARIS > - void (*comp_reg)(void); > -#endif > - > - scandir_entries = scandir (path, &scandir_list, lcr_select_so, alphasort); > - if (scandir_entries > 0) > - /* > - * no error so load the object > - */ > - for (libs_to_scan = 0; libs_to_scan < scandir_entries; libs_to_scan++) { > - /* > - * Load objects, scan them, unload them if they are not a match > - */ > - snprintf (dl_name, sizeof(dl_name), "%s/%s", > - path, scandir_list[libs_to_scan]->d_name); > - /* > - * Don't reload already loaded libraries > - */ > - if (lcr_lib_loaded (dl_name)) { > - continue; > - } > - dl_handle = dlopen (dl_name, RTLD_NOW); > - if (dl_handle == NULL) { > - fprintf(stderr, "%s: open failed: %s\n", > - dl_name, dlerror()); > - continue; > - } > -/* > - * constructors don't work in Solaris dlopen, so we have to specifically call > - * a function to register the component > - */ > -#ifdef COROSYNC_SOLARIS > - comp_reg = dlsym (dl_handle, "corosync_lcr_component_register"); > - comp_reg (); > -#endif > - instance = lcr_comp_find (iface_name, version, iface_number); > - if (instance) { > - instance->dl_handle = dl_handle; > - strcpy (instance->library_name, dl_name); > - goto found; > - } > - > - /* > - * No matching interfaces found, try next shared object > - */ > - if (g_component_handle != 0xFFFFFFFF) { > - hdb_handle_destroy (&lcr_component_instance_database, > - g_component_handle); > - g_component_handle = 0xFFFFFFFF; > - } > - dlclose (dl_handle); > - } /* scanning for lcrso loop */ > - > - > - if (scandir_entries > 0) { > - int i; > - for (i = 0; i < scandir_entries; i++) { > - free (scandir_list[i]); > - } > - free (scandir_list); > - } > - g_component_handle = 0xFFFFFFFF; > - return -1; > - > -found: > - *instance_ret = instance; > - if (scandir_entries > 0) { > - int i; > - for (i = 0; i < scandir_entries; i++) { > - free (scandir_list[i]); > - } > - free (scandir_list); > - } > - g_component_handle = 0xFFFFFFFF; > - return 0; > -} > - > -static unsigned int lcr_initialized = 0; > - > -void *lcr_ifact_addr_get(hdb_handle_t iface_handle, > - const char* symbol_name) > -{ > - struct lcr_iface_instance *iface_instance; > - struct lcr_component_instance *instance; > - void *ptr; > - > - hdb_handle_get (&lcr_iface_instance_database, > - iface_handle, (void *)&iface_instance); > - > - hdb_handle_get (&lcr_component_instance_database, > - iface_instance->component_handle, (void *)&instance); > - > - ptr = dlsym(instance->dl_handle, symbol_name); > - > - hdb_handle_put(&lcr_component_instance_database, > - iface_instance->component_handle); > - > - hdb_handle_put (&lcr_iface_instance_database, > - iface_handle); > - return ptr; > -} > - > - > -int lcr_ifact_reference ( > - hdb_handle_t *iface_handle, > - const char *iface_name, > - int version, > - void **iface, > - void *context) > -{ > - struct lcr_iface_instance *iface_instance; > - struct lcr_component_instance *instance; > - unsigned int iface_number; > - unsigned int res; > - unsigned int i; > - > - /* > - * Determine if the component is already loaded > - */ > - instance = lcr_comp_find (iface_name, version, &iface_number); > - if (instance) { > - goto found; > - } > - > - if (lcr_initialized == 0) { > - lcr_initialized = 1; > - defaults_path_build (); > - ld_library_path_build (); > - ldso_path_build ("/etc", "ld.so.conf"); > - } > - > -// TODO error checking in this code is weak > - /* > - * Search through all lcrso files for desired interface > - */ > - for (i = 0; i < path_list_entries; i++) { > - res = interface_find_and_load ( > - path_list[i], > - iface_name, > - version, > - &instance, > - &iface_number); > - > - if (res == 0) { > - goto found; > - } > - } > - > - /* > - * No matching interfaces found in all shared objects > - */ > - return (-1); > - > -found: > - *iface = instance->ifaces[iface_number].interfaces; > - if (instance->ifaces[iface_number].constructor) { > - instance->ifaces[iface_number].constructor (context); > - } > - hdb_handle_create (&lcr_iface_instance_database, > - sizeof (struct lcr_iface_instance), > - iface_handle); > - hdb_handle_get (&lcr_iface_instance_database, > - *iface_handle, (void *)&iface_instance); > - iface_instance->component_handle = instance->comp_handle; > - iface_instance->context = context; > - iface_instance->destructor = instance->ifaces[iface_number].destructor; > - hdb_handle_put (&lcr_iface_instance_database, *iface_handle); > - return (0); > -} > - > -int lcr_ifact_release (hdb_handle_t handle) > -{ > - struct lcr_iface_instance *iface_instance; > - int res = 0; > - > - res = hdb_handle_get (&lcr_iface_instance_database, > - handle, (void *)&iface_instance); > - > - if (iface_instance->destructor) { > - iface_instance->destructor (iface_instance->context); > - } > - > - hdb_handle_put (&lcr_component_instance_database, > - iface_instance->component_handle); > - hdb_handle_put (&lcr_iface_instance_database, handle); > - hdb_handle_destroy (&lcr_iface_instance_database, handle); > - > - return (res); > -} > - > -void lcr_component_register (struct lcr_comp *comp) > -{ > - struct lcr_component_instance *instance; > - static hdb_handle_t comp_handle; > - > - hdb_handle_create (&lcr_component_instance_database, > - sizeof (struct lcr_component_instance), > - &comp_handle); > - hdb_handle_get (&lcr_component_instance_database, > - comp_handle, (void *)&instance); > - > - instance->ifaces = comp->ifaces; > - instance->iface_count = comp->iface_count; > - instance->comp_handle = comp_handle; > - instance->dl_handle = NULL; > - > - hdb_handle_put (&lcr_component_instance_database, > - comp_handle); > - > - g_component_handle = comp_handle; > -} > diff --git a/lcr/libtest_a.c b/lcr/libtest_a.c > deleted file mode 100644 > index cfed120..0000000 > --- a/lcr/libtest_a.c > +++ /dev/null > @@ -1,166 +0,0 @@ > -/* > - * Copyright (C) 2006 Steven Dake (sdake@xxxxxxxxxx) > - * > - * This software licensed under BSD license, the text of which follows: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions are met: > - * > - * - Redistributions of source code must retain the above copyright notice, > - * this list of conditions and the following disclaimer. > - * - Redistributions in binary form must reproduce the above copyright notice, > - * this list of conditions and the following disclaimer in the documentation > - * and/or other materials provided with the distribution. > - * - Neither the name of the MontaVista Software, Inc. nor the names of its > - * contributors may be used to endorse or promote products derived from this > - * software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > - * THE POSSIBILITY OF SUCH DAMAGE. > - */ > - > -#include <config.h> > - > -#include <stdio.h> > -#include <corosync/lcr/lcr_comp.h> > - > -/* > - * Version 0 of the interface > - */ > -static int iface1_constructor (void *context); > - > -static void iface1_destructor (void *context); > - > -static void iface1_func1 (void); > - > -static void iface1_func2 (void); > - > -static void iface1_func3 (void); > - > -/* > - * Version 1 of the interface > - */ > -static int iface1_ver1_constructor (void *context); > - > -static void iface1_ver1_destructor (void *context); > - > -static void iface1_ver1_func1 (void); > - > -static void iface1_ver1_func2 (void); > - > -static void iface1_ver1_func3 (void); > - > -struct iface_list { > - void (*iface1_func1)(void); > - void (*iface1_func2)(void); > - void (*iface1_func3)(void); > -}; > - > -struct iface_ver1_list { > - void (*iface1_ver1_func1)(void); > - void (*iface1_ver1_func2)(void); > - void (*iface1_ver1_func3)(void); > -}; > - > -static struct iface_list iface_list = { > - .iface1_func1 = iface1_func1, > - .iface1_func2 = iface1_func2, > - .iface1_func3 = iface1_func3, > -}; > - > -static struct iface_list iface_ver1_list = { > - .iface1_func1 = iface1_ver1_func1, > - .iface1_func2 = iface1_ver1_func2, > - .iface1_func3 = iface1_ver1_func3, > -}; > - > -static struct lcr_iface iface1[2] = { > - /* version 0 */ > - { > - .name = "A_iface1", > - .version = 0, > - .versions_replace = 0, > - .versions_replace_count = 0, > - .dependencies = 0, > - .dependency_count = 0, > - .constructor = iface1_constructor, > - .destructor = iface1_destructor, > - .interfaces = NULL > - }, > - /* version 1 */ > - { > - .name = "A_iface1", > - .version = 1, > - .versions_replace = 0, > - .versions_replace_count = 0, > - .dependencies = 0, > - .dependency_count = 0, > - .constructor = iface1_ver1_constructor, > - .destructor = iface1_ver1_destructor, > - .interfaces = NULL > - } > -}; > - > -static struct lcr_comp test_comp = { > - .iface_count = 2, > - .ifaces = iface1 > -}; > - > -static int iface1_constructor (void *context) > -{ > - printf ("A - version 0 constructor context %p\n", context); > - return (0); > -} > - > -static void iface1_destructor (void *context) > -{ > - printf ("A - version 0 destructor context %p\n", context); > -} > -static void iface1_func1 (void) { > - printf ("A - version 0 func1\n"); > -} > - > -static void iface1_func2 (void) { > - printf ("A - version 0 func2\n"); > -} > - > -static void iface1_func3 (void) { > - printf ("A - version 0 func3\n"); > -} > - > -static int iface1_ver1_constructor (void *context) > -{ > - printf ("A - version 1 constructor context %p\n", context); > - return (0); > -} > - > -static void iface1_ver1_destructor (void *context) > -{ > - printf ("A - version 1 destructor context %p\n", context); > -} > -static void iface1_ver1_func1 (void) { > - printf ("A - version 1 func1\n"); > -} > - > -static void iface1_ver1_func2 (void) { > - printf ("A - version 1 func2\n"); > -} > - > -static void iface1_ver1_func3 (void) { > - printf ("A - version 1 func3\n"); > -} > - > -__attribute__ ((constructor)) static void register_this_component (void) { > - lcr_interfaces_set (&iface1[0], &iface_list); > - lcr_interfaces_set (&iface1[1], &iface_ver1_list); > - lcr_component_register (&test_comp); > -} > diff --git a/lcr/libtest_b.c b/lcr/libtest_b.c > deleted file mode 100644 > index 9ef68a2..0000000 > --- a/lcr/libtest_b.c > +++ /dev/null > @@ -1,174 +0,0 @@ > -/* > - * Copyright (C) 2006 Steven Dake (sdake@xxxxxxxxxx) > - * > - * This software licensed under BSD license, the text of which follows: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions are met: > - * > - * - Redistributions of source code must retain the above copyright notice, > - * this list of conditions and the following disclaimer. > - * - Redistributions in binary form must reproduce the above copyright notice, > - * this list of conditions and the following disclaimer in the documentation > - * and/or other materials provided with the distribution. > - * - Neither the name of the MontaVista Software, Inc. nor the names of its > - * contributors may be used to endorse or promote products derived from this > - * software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > - * THE POSSIBILITY OF SUCH DAMAGE. > - */ > - > -#include <config.h> > - > -#include <stdio.h> > -#include <corosync/lcr/lcr_comp.h> > - > -/* > - * Version 0 of the interface > - */ > -static int iface1_constructor (void *context); > - > -static void iface1_destructor (void *context); > - > -static void iface1_func1 (void); > - > -static void iface1_func2 (void); > - > -static void iface1_func3 (void); > - > -/* > - * Version 1 of the interface > - */ > -static int iface1_ver1_constructor (void *context); > - > -static void iface1_ver1_destructor (void *context); > - > -static void iface1_ver1_func1 (void); > - > -static void iface1_ver1_func2 (void); > - > -static void iface1_ver1_func3 (void); > - > -struct iface_list { > - void (*iface1_func1)(void); > - void (*iface1_func2)(void); > - void (*iface1_func3)(void); > -}; > - > -struct iface_ver1_list { > - void (*iface1_ver1_func1)(void); > - void (*iface1_ver1_func2)(void); > - void (*iface1_ver1_func3)(void); > -}; > - > -struct iface_list iface_list = { > - .iface1_func1 = iface1_func1, > - .iface1_func2 = iface1_func2, > - .iface1_func3 = iface1_func3, > -}; > - > -struct iface_list iface_ver1_list = { > - .iface1_func1 = iface1_ver1_func1, > - .iface1_func2 = iface1_ver1_func2, > - .iface1_func3 = iface1_ver1_func3, > -}; > - > -struct lcr_iface iface1[2]= { > - /* > - * Version 0 > - */ > - { > - .name = "B_iface1", > - .version = 0, > - .versions_replace = 0, > - .versions_replace_count = 0, > - .dependencies = 0, > - .dependency_count = 0, > - .constructor = iface1_constructor, > - .destructor = iface1_destructor, > - .interfaces = NULL > - }, > - /* > - * Version 1 > - */ > - { > - .name = "B_iface1", > - .version = 1, > - .versions_replace = 0, > - .versions_replace_count = 0, > - .dependencies = 0, > - .dependency_count = 0, > - .constructor = iface1_ver1_constructor, > - .destructor = iface1_ver1_destructor, > - .interfaces = NULL > - } > -}; > - > -struct lcr_comp test_comp = { > - .iface_count = 2, > - .ifaces = iface1 > -}; > - > -static int iface1_constructor (void *context) > -{ > - printf ("B - version 0 constructor context %p\n", context); > - return (0); > -} > - > -static void iface1_destructor (void *context) > -{ > - printf ("B - version 0 destructor context %p\n", context); > -} > - > -static void iface1_func1 (void) { > - printf ("B - version 0 func1\n"); > -} > - > -static void iface1_func2 (void) { > - printf ("B - version 0 func2\n"); > -} > - > -static void iface1_func3 (void) { > - printf ("B - version 0 func3\n"); > -} > - > -static int iface1_ver1_constructor (void *context) > -{ > - printf ("B - version 1 constructor context %p\n", context); > - return (0); > -} > - > -static void iface1_ver1_destructor (void *context) > -{ > - printf ("B - version 1 destructor context %p\n", context); > -} > - > -static void iface1_ver1_func1 (void) { > - printf ("B - version 1 func1\n"); > -} > - > -static void iface1_ver1_func2 (void) { > - printf ("B - version 1 func2\n"); > -} > - > -static void iface1_ver1_func3 (void) { > - printf ("B - version 1 func3\n"); > -} > - > -__attribute__ ((constructor)) static void register_this_component (void) > -{ > - lcr_interfaces_set (&iface1[0], &iface_list); > - lcr_interfaces_set (&iface1[1], &iface_ver1_list); > - > - lcr_component_register (&test_comp); > -} > diff --git a/lcr/test.c b/lcr/test.c > deleted file mode 100644 > index 4c01ba2..0000000 > --- a/lcr/test.c > +++ /dev/null > @@ -1,129 +0,0 @@ > -/* > - * Copyright (C) 2006 Steven Dake (sdake@xxxxxxxxxx) > - * > - * This software licensed under BSD license, the text of which follows: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions are met: > - * > - * - Redistributions of source code must retain the above copyright notice, > - * this list of conditions and the following disclaimer. > - * - Redistributions in binary form must reproduce the above copyright notice, > - * this list of conditions and the following disclaimer in the documentation > - * and/or other materials provided with the distribution. > - * - Neither the name of the MontaVista Software, Inc. nor the names of its > - * contributors may be used to endorse or promote products derived from this > - * software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > - * THE POSSIBILITY OF SUCH DAMAGE. > - */ > - > -#include <config.h> > - > -#include <assert.h> > -#include <unistd.h> > -#include <corosync/hdb.h> > -#include <corosync/lcr/lcr_ifact.h> > - > -struct iface { > - void (*func1) (void); > - void (*func2) (void); > - void (*func3) (void); > -}; > - > -int main (void) { > - hdb_handle_t a_ifact_handle_ver0; > - hdb_handle_t b_ifact_handle_ver0; > - struct iface *a_iface_ver0; > - struct iface *a_iface_ver1; > - void *a_iface_ver0_p; > - void *a_iface_ver1_p; > - > - hdb_handle_t a_ifact_handle_ver1; > - hdb_handle_t b_ifact_handle_ver1; > - struct iface *b_iface_ver0; > - struct iface *b_iface_ver1; > - void *b_iface_ver0_p; > - void *b_iface_ver1_p; > - > - unsigned int res; > - > - /* > - * Reference version 0 and 1 of A and B interfaces > - */ > - res = lcr_ifact_reference ( > - &a_ifact_handle_ver0, > - "A_iface1", > - 0, /* version 0 */ > - &a_iface_ver0_p, > - (void *)0xaaaa0000); > - assert (res == 0); > - > - a_iface_ver0 = (struct iface *)a_iface_ver0_p; > - > - res = lcr_ifact_reference ( > - &b_ifact_handle_ver0, > - "B_iface1", > - 0, /* version 0 */ > - &b_iface_ver0_p, > - (void *)0xbbbb0000); > - assert (res == 0); > - > - b_iface_ver0 = (struct iface *)b_iface_ver0_p; > - > - res = lcr_ifact_reference ( > - &a_ifact_handle_ver1, > - "A_iface1", > - 1, /* version 1 */ > - &a_iface_ver1_p, > - (void *)0xaaaa1111); > - assert (res == 0); > - > - a_iface_ver1 = (struct iface *)a_iface_ver1_p; > - > - res = lcr_ifact_reference ( > - &b_ifact_handle_ver1, > - "B_iface1", > - 1, /* version 1 */ > - &b_iface_ver1_p, > - (void *)0xbbbb1111); > - assert (res == 0); > - > - b_iface_ver1 = (struct iface *)b_iface_ver1_p; > - > - a_iface_ver0->func1(); > - a_iface_ver0->func2(); > - a_iface_ver0->func3(); > - > - lcr_ifact_release (a_ifact_handle_ver0); > - > - a_iface_ver1->func1(); > - a_iface_ver1->func2(); > - a_iface_ver1->func3(); > - > - lcr_ifact_release (a_ifact_handle_ver1); > - > - b_iface_ver0->func1(); > - b_iface_ver0->func2(); > - b_iface_ver0->func3(); > - > - lcr_ifact_release (b_ifact_handle_ver0); > - > - b_iface_ver1->func1(); > - b_iface_ver1->func2(); > - b_iface_ver1->func3(); > - > - lcr_ifact_release (b_ifact_handle_ver1); > - > - return (0); > -} > diff --git a/lcr/uic.c b/lcr/uic.c > deleted file mode 100755 > index 9e2688e..0000000 > --- a/lcr/uic.c > +++ /dev/null > @@ -1,157 +0,0 @@ > -/* > - * Copyright (c) 2006 Steven Dake (sdake@xxxxxxxxxx) > - * > - * This software licensed under BSD license, the text of which follows: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions are met: > - * > - * - Redistributions of source code must retain the above copyright notice, > - * this list of conditions and the following disclaimer. > - * - Redistributions in binary form must reproduce the above copyright notice, > - * this list of conditions and the following disclaimer in the documentation > - * and/or other materials provided with the distribution. > - * - Neither the name of the MontaVista Software, Inc. nor the names of its > - * contributors may be used to endorse or promote products derived from this > - * software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > - * THE POSSIBILITY OF SUCH DAMAGE. > - */ > - > -#include <config.h> > - > -#include <sys/uio.h> > -#include <sys/mman.h> > -#include <sys/types.h> > -#include <sys/socket.h> > -#include <sys/un.h> > -#include <sys/time.h> > -#include <sys/resource.h> > -#include <netinet/in.h> > -#include <arpa/inet.h> > -#include <unistd.h> > -#include <fcntl.h> > -#include <stdlib.h> > -#include <stdio.h> > -#include <errno.h> > -#include <sched.h> > -#include <time.h> > -#include <pthread.h> > -#include <sys/poll.h> > -#include <string.h> > - > -#if defined(COROSYNC_LINUX) || defined(COROSYNC_SOLARIS) > -/* SUN_LEN is broken for abstract namespace > - */ > -#define AIS_SUN_LEN(a) sizeof(*(a)) > -#else > -#define AIS_SUN_LEN(a) SUN_LEN(a) > -#endif > - > -#ifdef COROSYNC_LINUX > -static const char *socketname = "lcr.socket"; > -#else > -static const char *socketname = SOCKETDIR "/lcr.socket"; > -#endif > - > -static int uic_connect (int *fd); > - > -static int uic_msg_send (int fd, void *msg); > - > -int uic_connect (int *fd) > -{ > - int res; > - struct sockaddr_un addr; > - > - memset (&addr, 0, sizeof (struct sockaddr_un)); > -#if defined(COROSYNC_BSD) || defined(COROSYNC_DARWIN) > - addr.sun_len = sizeof(struct sockaddr_un); > -#endif > - addr.sun_family = PF_UNIX; > -#if defined(COROSYNC_LINUX) > - strcpy (addr.sun_path + 1, socketname); > -#else > - strcpy (addr.sun_path, socketname); > -#endif > - *fd = socket (PF_UNIX, SOCK_STREAM, 0); > - if (*fd == -1) { > - return -errno; > - } > - res = connect (*fd, (struct sockaddr *)&addr, AIS_SUN_LEN(&addr)); > - if (res == -1) { > - return -errno; > - } > - return 0; > -} > - > -struct uic_req_msg { > - int len; > - char msg[0]; > -}; > - > -static int uic_msg_send (int fd, void *msg) > -{ > - struct msghdr msg_send; > - struct iovec iov_send[2]; > - struct uic_req_msg req_msg; > - ssize_t send_res; > - int res; > - > - req_msg.len = strlen (msg) + 1; > - iov_send[0].iov_base = (void *)&req_msg; > - iov_send[0].iov_len = sizeof (struct uic_req_msg); > - iov_send[1].iov_base = msg; > - iov_send[1].iov_len = req_msg.len; > - > - msg_send.msg_iov = iov_send; > - msg_send.msg_iovlen = 2; > - msg_send.msg_name = 0; > - msg_send.msg_namelen = 0; > -#ifndef COROSYNC_SOLARIS > - msg_send.msg_control = 0; > - msg_send.msg_controllen = 0; > - msg_send.msg_flags = 0; > -#else > - msg_send.msg_accrights = NULL; > - msg_send.msg_accrightslen = 0; > -#endif > - > - retry_send: > - send_res = sendmsg (fd, &msg_send, 0); > - if (send_res == -1 && errno == EINTR) { > - goto retry_send; > - } > - if (send_res == -1) { > - res = -errno; > - } else { > - res = (int)send_res; > - } > - return (res); > - > -} > - > - > -int main (void) > -{ > - int client_fd; > - int res; > - char command[128] = "livereplace ckpt version2"; > - > - res = uic_connect (&client_fd); > - if (res != 0) { > - printf ("Couldn't connect to live replacement service\n"); > - } > - uic_msg_send (client_fd, (void *)command); > - > - return 0; > -} > diff --git a/lcr/uis.c b/lcr/uis.c > deleted file mode 100755 > index a2a5896..0000000 > --- a/lcr/uis.c > +++ /dev/null > @@ -1,205 +0,0 @@ > -/* > - * Copyright (c) 2006 Steven Dake (sdake@xxxxxxxxxx) > - * > - * This software licensed under BSD license, the text of which follows: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions are met: > - * > - * - Redistributions of source code must retain the above copyright notice, > - * this list of conditions and the following disclaimer. > - * - Redistributions in binary form must reproduce the above copyright notice, > - * this list of conditions and the following disclaimer in the documentation > - * and/or other materials provided with the distribution. > - * - Neither the name of the MontaVista Software, Inc. nor the names of its > - * contributors may be used to endorse or promote products derived from this > - * software without specific prior written permission. > - * > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE > - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > - * THE POSSIBILITY OF SUCH DAMAGE. > - */ > - > -#include <config.h> > - > -#include <sys/uio.h> > -#include <sys/mman.h> > -#include <sys/types.h> > -#include <sys/socket.h> > -#include <sys/un.h> > -#include <sys/time.h> > -#include <sys/resource.h> > -#include <netinet/in.h> > -#include <arpa/inet.h> > -#include <unistd.h> > -#include <fcntl.h> > -#include <stdlib.h> > -#include <stdio.h> > -#include <errno.h> > -#include <sched.h> > -#include <time.h> > -#include <pthread.h> > -#include <sys/poll.h> > -#include <string.h> > - > -#define SERVER_BACKLOG 5 > - > -#if defined(COROSYNC_LINUX) || defined(COROSYNC_SOLARIS) > -/* SUN_LEN is broken for abstract namespace > - */ > -#define AIS_SUN_LEN(a) sizeof(*(a)) > -#else > -#define AIS_SUN_LEN(a) SUN_LEN(a) > -#endif > - > -#ifdef COROSYNC_LINUX > -static const char *socketname = "lcr.socket"; > -#else > -static const char *socketname = SOCKETDIR "/lcr.socket"; > -#endif > - > -static void uis_lcr_bind (int *server_fd) > -{ > - int fd; > - struct sockaddr_un un_addr; > - int res; > - > - /* > - * Create socket for lcr clients, name socket, listen for connections > - */ > - fd = socket (PF_UNIX, SOCK_STREAM, 0); > - if (fd == -1) { > - perror ("uis_lcr_bind failed"); > - *server_fd = -1; > - return; > - }; > - > -#if !defined(COROSYNC_LINUX) > - unlink(socketname); > -#endif > - memset (&un_addr, 0, sizeof (struct sockaddr_un)); > -#if defined(COROSYNC_BSD) || defined(COROSYNC_DARWIN) > - un_addr.sun_len = sizeof(struct sockaddr_un); > -#endif > - un_addr.sun_family = AF_UNIX; > -#if defined(COROSYNC_LINUX) > - strcpy (un_addr.sun_path + 1, socketname); > -#else > - strcpy (un_addr.sun_path, socketname); > -#endif > - > - res = bind (fd, (struct sockaddr *)&un_addr, AIS_SUN_LEN(&un_addr)); > - if (res) { > - char error_str[100]; > - const char *error_ptr; > -#ifdef _GNU_SOURCE > -/* The GNU version of strerror_r returns a (char*) that *must* be used */ > - error_ptr = strerror_r(errno, error_str, sizeof(error_str)); > -#else > -/* The XSI-compliant strerror_r() return 0 or -1 (in case the buffer is full) */ > - strerror_r(errno, error_str, sizeof(error_str)); > - error_ptr = error_str; > -#endif > - printf ("Could not bind AF_UNIX: %s\n", error_ptr); > - } > - listen (fd, SERVER_BACKLOG); > - *server_fd = fd; > -} > - > -struct uis_commands { > - const char *command; > - void (*cmd_handler) (char *); > -}; > - > -static void cmd1 (char *cmd) { > - printf ("cmd1 executed with cmd line %s\n", cmd); > -} > - > -struct uis_commands uis_commands[] = { > - { > - "cmd1", cmd1 > - } > -}; > - > -struct uis_req_msg { > - int len; > - char msg[0]; > -}; > - > -static void lcr_uis_dispatch (int fd) > -{ > - struct uis_req_msg header; > - char msg_contents[512]; > - ssize_t readsize; > - > - /* > - * TODO this doesn't handle short reads > - */ > - readsize = read (fd, &header, sizeof (header)); > - if (readsize == -1) { > - return; > - } > - readsize = read (fd, msg_contents, sizeof (msg_contents)); > - if (readsize == -1) { > - return; > - } > - > - printf ("msg contents %s\n", msg_contents); > -} > - > -static void *lcr_uis_server (void *data) > -{ > - struct pollfd ufds[2]; > - struct sockaddr_un un_addr; > - socklen_t addrlen; > - int nfds = 1; > -#ifdef COROSYNC_LINUX > - int on = 1; > -#endif > - > - /* > - * Main acceptance and dispatch loop > - */ > - uis_lcr_bind (&ufds[0].fd); > - printf ("UIS server thread started %d\n", ufds[0].fd); > - ufds[0].events = POLLIN; > - ufds[1].events = POLLOUT; > - for (;;) { > - int res = poll (ufds, nfds, -1); > - if (res == 0 || (res < 0 && errno == EINTR)) > - continue; > - if (res < 0) > - return NULL; > - if (nfds == 1 && ufds[0].revents & POLLIN) { > - ufds[1].fd = accept (ufds[0].fd, > - (struct sockaddr *)&un_addr, &addrlen); > -#ifdef COROSYNC_LINUX > - if (ufds[1].fd >= 0) { > - setsockopt(ufds[1].fd, SOL_SOCKET, SO_PASSCRED, > - &on, sizeof (on)); > - } > -#endif > - nfds = 2; > - } > - if (ufds[1].fd >= 0 && (ufds[0].revents & POLLIN)) { > - lcr_uis_dispatch (ufds[1].fd); > - } > - } > -} > - > -__attribute__ ((constructor)) static int lcr_uis_ctors (void) > -{ > - pthread_t thread; > - > - pthread_create (&thread, NULL, lcr_uis_server, NULL); > - > - return (0); > -} > diff --git a/lib/Makefile.am b/lib/Makefile.am > index 0262453..d2dd8ed 100644 > --- a/lib/Makefile.am > +++ b/lib/Makefile.am > @@ -67,9 +67,6 @@ noinst_HEADERS = util.h \ > libquorum.versions libvotequorum.versions \ > libsam.versions libcmap.versions > > -../lcr/lcr_ifact.o: > - $(MAKE) -C ../lcr lcr_ifact.o > - > if BUILD_DARWIN > > lib%.so: lib%.a $(LIBQB_LIBS) > diff --git a/loc b/loc > index a9db13c..ce502f4 100755 > --- a/loc > +++ b/loc > @@ -12,9 +12,6 @@ printf "%7.7s\n" `find lib -name *.[ch] -exec cat {} \; | wc -l` > echo -n "include LOC " > printf "%7.7s\n" `find include -name *.[ch] -exec cat {} \; | wc -l` > > -echo -n "lcr LOC " > -printf "%7.7s\n" `find lcr -name *.[ch] -exec cat {} \; | wc -l` > - > echo -n "test LOC " > printf "%7.7s\n" `find test -name *.[ch] -exec cat {} \; | wc -l` > > diff --git a/pkgconfig/corosync.pc.in b/pkgconfig/corosync.pc.in > index 31b354a..f166d01 100644 > --- a/pkgconfig/corosync.pc.in > +++ b/pkgconfig/corosync.pc.in > @@ -2,7 +2,6 @@ prefix=@PREFIX@ > exec_prefix=${prefix} > libdir=@LIBDIR@ > includedir=${prefix}/include > -lcrsodir=@COROLCRSODIR@ > socketdir=@COROSOCKETDIR@ > > Name: corosync > diff --git a/tools/Makefile.am b/tools/Makefile.am > index fa9ee38..921cd26 100644 > --- a/tools/Makefile.am > +++ b/tools/Makefile.am > @@ -59,10 +59,10 @@ corosync_cfgtool_LDFLAGS= -L../lib > corosync_cpgtool_LDADD = -lcfg -lcpg $(LIBQB_LIBS) > corosync_cpgtool_LDFLAGS= -L../lib > corosync_quorumtool_LDADD = -lcmap -lcfg -lquorum \ > - -lvotequorum ../lcr/liblcr.a $(LIBQB_LIBS) > + -lvotequorum $(LIBQB_LIBS) > corosync_quorumtool_LDFLAGS = -L../lib > > -corosync_notifyd_LDADD = -lcfg -lcmap ../lcr/liblcr.a \ > +corosync_notifyd_LDADD = -lcfg -lcmap \ > $(LIBQB_LIBS) $(DBUS_LIBS) $(SNMPLIBS) \ > -lquorum > corosync_notifyd_LDFLAGS = -L../lib _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss