powerguru-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Powerguru-commit] [SCM] powerguru branch, master, updated. 980a5d65f08a


From: Rob Savoye
Subject: [Powerguru-commit] [SCM] powerguru branch, master, updated. 980a5d65f08a093dcb24fb7b73cc16f02b9193a4
Date: Sun, 13 Jan 2019 11:54:43 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "powerguru".

The branch, master has been updated
       via  980a5d65f08a093dcb24fb7b73cc16f02b9193a4 (commit)
       via  924ded2dd64fb001ac3643f296dd8cf146e25138 (commit)
       via  3b90684044b170677ce32f7353b74fa285ac5567 (commit)
       via  43ed89664d707e74d873826956cf9effaa9a888d (commit)
       via  387197b820ceed4dfb14d73ef8703b48e5d7065a (commit)
       via  cc09b278b108d53578d8798da05690c09bb571f1 (commit)
       via  e654bf5acbf6876b7069b7c07d05caf01788b299 (commit)
       via  c547928aff16337757eba32fd32940873615d182 (commit)
      from  a7bed69c0ac6756f5af5629bf33be6f0aec27962 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=980a5d65f08a093dcb24fb7b73cc16f02b9193a4


commit 980a5d65f08a093dcb24fb7b73cc16f02b9193a4
Author: Rob Savoye <address@hidden>
Date:   Sat Jan 12 22:43:08 2019 -0700

    Add support to install the python scripts

diff --git a/Makefile.am b/Makefile.am
index 8f3dab0..50566c5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,6 @@
 # 
-#  Copyright (C) 2003, 2004-2018.
+# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+#               2014, 2015, 2016, 2017, 2018, 2019
 #      Free Software Foundation, Inc.
 # 
 # This program is free software; you can redistribute it and/or modify
@@ -22,7 +23,8 @@ AUTOMAKE_OPTIONS = dejagnu
 ACLOCAL_AMFLAGS = -I macros
 
 # these have to be built first
-SUBDIRS = lib testsuite # doc
+# FIXME: make python optional
+SUBDIRS = lib testsuite doc python
 
 # this is an optional build directory
 if BUILD_SNMP
@@ -80,9 +82,13 @@ EXTRA_DIST = \
 
 # Install executables into qemu, which we do a lot when experimenting with
 # toolchains and cross compiing something that actually works.
-install-bin:
+install-qemu:
        rsync -avrp -e "ssh -p 5022" client/pguru daemon/pgd localhost:/tmp/
 
+# Note that this requires an entry in /etc/hostsfor 'pi'
+install-pi: install
+       rsync -avrp /tmp/foo pi:/tmp/
+
 # Build an RPM package
 rpm redhat: dist-gzip $(srcdir)/rpm/powerguru.spec
        cp -f $(srcdir)/rpm/powerguru.spec /usr/src/redhat/SPECS/
@@ -95,6 +101,7 @@ deb debian: dist-bzip2 $(srcdir)/debian/rules
        tar jxf powerguru-${VERSION}.tar.bz2
        cp -fr $(srcdir)/debian powerguru-${VERSION}/
        (cd powerguru-${VERSION}; dpkg-buildpackage)
+#      (cd powerguru-${VERSION}; dpkg-buildpackage --host-arch armhf -us -uc 
-b )
 
 mudflap:
        @echo "Rebuilding with GCC Mudflap support"
@@ -103,6 +110,9 @@ mudflap:
 apidoc:
        $(MAKE) -C doc $@
 
+pip-install:
+       pip3 install --upgrade -e $(top_srcdir)/python
+
 # Google's C++ utility https://github.com/myint/cppclean
 cppclean:
        @-cppclean --include-path=. --include-path=$(top_srcdir)/lib 
$(top_srcdir)/devices >& /tmp/cppclean.tmp
diff --git a/configure.ac b/configure.ac
index 11eff9d..1b0bd98 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,7 @@ AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([macros])
+AM_PATH_PYTHON([3])
 
 dnl Use the DMalloc library, if specified.
 AM_WITH_DMALLOC
@@ -230,6 +231,9 @@ save_CXXFLAGS="${CXXFLAGS}"
 save_CPPFLAGS="${CPPFLAGS}"
 save_CFLAGS="${CFLAGS}"
 
+dnl THe 2011 C++ standard added many Boost libraries to the
+dnl standard so we use those instead of wrapping C code like
+dnl the good old days...
 CFLAGS="--std=c++11"
 AC_MSG_CHECKING([For C++11 support])
 AC_TRY_COMPILE([#include <time.h>], [
@@ -240,7 +244,7 @@ AC_TRY_COMPILE([#include <time.h>], [
 )
 AC_MSG_RESULT([${has_c11}])
 if test x"${has_c11}" = x"no"; then
-  AC_MSG_ERROR([You need a C++ compiler that support the C++11 standard])
+  AC_MSG_ERROR([You need a C++ compiler that supports the C++11 standard])
 fi
 
 dnl Force warningto cause an error for compile tests
@@ -384,6 +388,16 @@ AC_TRY_COMPILE([#include <boost/filesystem.hpp>], [
 )
 AC_MSG_RESULT([${has_boost_filesystem}])
 
+dnl FIXME: need test for boost log, which isn't in Centos 7.6, aka... boost 
1.53
+AC_MSG_CHECKING([For Boost log development files])
+AC_TRY_COMPILE([#include <boost/log/core.hpp>], [
+  int foo = BOOST_LOG_CORE_HPP_INCLUDED_;
+  ],
+  has_boost_log=yes,
+  has_boost_log=no
+)
+AC_MSG_RESULT([${has_boost_log}])
+
 AC_MSG_CHECKING([For Boost regex development files])
 AC_TRY_COMPILE([#include <boost/regex.hpp>], [
   boost::regex re;
@@ -402,6 +416,7 @@ AC_TRY_COMPILE([#include <boost/system/error_code.hpp>], [
 )
 AC_MSG_RESULT([${has_boost_system}])
 
+
 dnl We need all of these boost libraries
 if (test x"${has_boost_filesystem}" = x"no" \
    -o x"${has_boost_regex}" = x"no" -o x"${has_boost_system}" = x"np"); then
@@ -480,7 +495,7 @@ dnl link to the images so we can browse the HTML output 
before
 dnl installing it.
 dnl Link to the python code so it's easier to use from the builddir.
 AC_LINK_FILES(doc/C/images,doc/C/images)
-AC_LINK_FILES(python,python)
+dnl AC_LINK_FILES(python,python)
 
 
 AC_OUTPUT([
@@ -495,6 +510,7 @@ po/Makefile.in
 doc/Makefile
 doc/Doxyfile
 doc/C/Makefile
+python/Makefile
 testsuite/Makefile
 testsuite/libtests/Makefile
 ])
diff --git a/python/Makefile.am b/python/Makefile.am
new file mode 100644
index 0000000..efc8977
--- /dev/null
+++ b/python/Makefile.am
@@ -0,0 +1,29 @@
+# 
+# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+#               2014, 2015, 2016, 2017, 2018, 2019
+#      Free Software Foundation, Inc.
+# 
+# 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, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+AUTOMAKE_OPTIONS = 
+
+python_PYTHON = mergedb.py onewire.py ownet.py chart.py pgd.py
+
+install-exec-local:
+       $(mkinstalldirs) $(DESTDIR)$(pkgpythondir)
+       $(PYTHON) $(srcdir)/setup.py install \
+       --prefix $(DESTDIR)$(prefix) \
+       --record $(DESTDIR)$(pkgpythondir)/install_files.txt \
+       --verbose

http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=924ded2dd64fb001ac3643f296dd8cf146e25138


commit 924ded2dd64fb001ac3643f296dd8cf146e25138
Author: Rob Savoye <address@hidden>
Date:   Sat Jan 12 21:54:40 2019 -0700

    Oops, newer everything

diff --git a/debian/compat b/debian/compat
index 7f8f011..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+9

http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=3b90684044b170677ce32f7353b74fa285ac5567


commit 3b90684044b170677ce32f7353b74fa285ac5567
Author: Rob Savoye <address@hidden>
Date:   Sat Jan 12 21:53:06 2019 -0700

    Needed for newer dpkg build tools

diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7

http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=43ed89664d707e74d873826956cf9effaa9a888d


commit 43ed89664d707e74d873826956cf9effaa9a888d
Author: Rob Savoye <address@hidden>
Date:   Sat Jan 12 21:23:27 2019 -0700

    Separate out the python version into it's own package.

diff --git a/debian/powerguru.install b/debian/powerguru.install
new file mode 100644
index 0000000..31ef420
--- /dev/null
+++ b/debian/powerguru.install
@@ -0,0 +1,2 @@
+/usr/pgd/pgd
+/usr/bin/pguru
diff --git a/debian/pypowerguru.install b/debian/pypowerguru.install
new file mode 100644
index 0000000..10a9e84
--- /dev/null
+++ b/debian/pypowerguru.install
@@ -0,0 +1,2 @@
+/usr/pgd/pgd.py
+/usr/bin/pguru.py

http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=387197b820ceed4dfb14d73ef8703b48e5d7065a


commit 387197b820ceed4dfb14d73ef8703b48e5d7065a
Author: Rob Savoye <address@hidden>
Date:   Sat Jan 12 18:37:24 2019 -0700

    Using boost error codes now

diff --git a/client/cmd.cc b/client/cmd.cc
index 7854a06..ff5dd6d 100644
--- a/client/cmd.cc
+++ b/client/cmd.cc
@@ -1,5 +1,6 @@
 // 
-// Copyright (C) 2005, 2006 - 2018
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+//               2014, 2015, 2016, 2017, 2018, 2019
 //      Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
@@ -26,11 +27,9 @@
 #include <queue>
 #include <condition_variable>
 #include <boost/asio.hpp>
-#include "tcpip.h"
 #include "console.h"
-#include "msgs.h"
 #include "log.h"
-#include "tcpip.h"
+#include "xml.h"
 #include "ownet.h"
 
 static void usage (const char *);
@@ -42,6 +41,8 @@ extern void damn_handler(boost::asio::ip::tcp::socket &sock);
 
 using namespace boost::asio;
 using namespace boost::asio::ip;
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
 
 std::mutex queue_lock;
 std::queue <XML> tqueue;
@@ -53,7 +54,7 @@ main(int argc, char *argv[])
     int         c;
     std::string dbhost = "localhost";
     std::string pserver = "pi";
-    retcode_t   ret;
+    boost::system::error_code ret;
 
     log_init("pguru");
     // scan for the two main standard GNU options
diff --git a/client/threads.cc b/client/threads.cc
index 4f36940..3bdae5e 100644
--- a/client/threads.cc
+++ b/client/threads.cc
@@ -1,5 +1,5 @@
 // 
-// Copyright (C) 2018 Free Software Foundation, Inc.
+// Copyright (C) 2018, 2019 Free Software Foundation, Inc.
 // 
 // 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
@@ -45,13 +45,14 @@
 #include "ownet.h"
 #include "console.h"
 #include "database.h"
-#include "tcpip.h"
 #include "xml.h"
 #include "commands.h"
 
 using namespace std::chrono_literals;
 using namespace boost::asio;
 using namespace boost::asio::ip;
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
 
 // This queue is used to pass data between the threads.
 extern std::mutex queue_lock;
@@ -100,7 +101,7 @@ daemon_handler(boost::asio::ip::tcp::socket &tcp_socket)
 {
     DEBUGLOG_REPORT_FUNCTION;
 
-    retcode_t ret;
+    boost::system::error_code ret;
     boost::asio::io_service ioservice;
     tcp::resolver       resolv{ioservice};
     std::array<char, 1024> bytes;
diff --git a/daemon/main.cc b/daemon/main.cc
index ecc3717..1f9dc56 100644
--- a/daemon/main.cc
+++ b/daemon/main.cc
@@ -42,6 +42,8 @@ extern int optind;
 extern char *optarg;
 #endif
 
+#include <boost/asio.hpp>
+
 #include "log.h"
 #ifdef BUILD_XANTREX
 include "xantrex-trace.h"
@@ -58,19 +60,19 @@ include "xantrex-trace.h"
 #include "database.h"
 #include "snmp.h"
 #include "rc.h"
-#include "tcpip.h"
-//#include "xml.h"
 #include "serial.h"
 #include "commands.h"
 #include "onewire.h"
-
-using namespace rcinit;
+using namespace boost::asio;
+using namespace boost::asio::ip;
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
 
 static void usage (const char *);
 
 // Protoypes for the threads entry point
 extern void onewire_handler(Onewire &ow);
-extern void client_handler(Tcpip &net);
+extern void client_handler(boost::asio::ip::tcp::socket &tcp_socket);
 extern void ownet_handler(Ownet &);
 extern void outback_handler(Ownet &);
 extern void xantrex_handler(Ownet &);
@@ -83,6 +85,9 @@ std::condition_variable queue_cond;
 // Note that an entry for 'pi' needs to be in /etc/hosts.
 const char DEFAULT_ARGV[] = "-s pi:4304";
 
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
+
 int
 main(int argc, char *argv[])
 {
@@ -94,7 +99,7 @@ main(int argc, char *argv[])
     bool snmp;
     bool daemon;
     bool client;
-    retcode_t   ret;
+    boost::system::error_code   ret;
     std::condition_variable alldone;
 
     log_init("/tmp/pgd");
@@ -156,7 +161,7 @@ main(int argc, char *argv[])
           case 'v':
               // verbosity++;
               //dbglogfile.set_verbosity();
-              BOOST_LOG(lg) << "FIXME: Verbose output turned on";
+              BOOST_LOG(lg) << "FIXME: Verbose output NOT turned on";
               break;
        
           default:
@@ -172,10 +177,17 @@ main(int argc, char *argv[])
         agent.master(false);
     }
 #endif
+    io_service ioservice;
+    tcp::endpoint tcp_endpoint{tcp::v4(), 7654};
+    tcp::acceptor tcp_acceptor{ioservice, tcp_endpoint};
+    tcp::socket tcp_socket{ioservice};
+    std::string data;
+    tcp::resolver resolv{ioservice};
+    std::array<char, 4096> bytes;
+    std::thread client_thread (client_handler, std::ref(tcp_socket));
+
     Onewire ow;
     std::thread onewire_thread (onewire_handler, std::ref(ow));
-    Tcpip net;
-    std::thread client_thread (client_handler, std::ref(net));
 #ifdef BUILD_OWNET
     Ownet ownet(owserver);
     std::thread ownet_thread (ownet_handler, std::ref(ownet));
diff --git a/daemon/threads.cc b/daemon/threads.cc
index 26d0b4a..a04e61b 100644
--- a/daemon/threads.cc
+++ b/daemon/threads.cc
@@ -1,5 +1,5 @@
 // 
-// Copyright (C) 2018 Free Software Foundation, Inc.
+// Copyright (C) 2018, 2019 Free Software Foundation, Inc.
 // 
 // 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
@@ -45,7 +45,6 @@ extern char *optarg;
 #include "ownet.h"
 #include "console.h"
 #include "database.h"
-#include "tcpip.h"
 #include "xml.h"
 #include "commands.h"
 #include "onewire.h"
@@ -126,11 +125,11 @@ onewire_handler(Onewire &onewire)
 }
 
 void
-client_handler(Tcpip &net)
+client_handler(boost::asio::ip::tcp::socket &sock)
 {
     DEBUGLOG_REPORT_FUNCTION;
 
-    retcode_t ret;
+    boost::system::error_code ret;
     Commands cmd;
     int retries = 3;
     std::string hostname;
@@ -176,11 +175,10 @@ client_handler(Tcpip &net)
     while (loop) {
         std::memset(bytes.data(), 0, bytes.size());
         tcp_socket.read_some(buffer(bytes), error);
-        std::cerr << bytes.data();
         // Client dropped connection
         if (error == boost::asio::error::eof)
             break;
-        // if the first character is a <, assume it's in XML formst.
+        // if the first c-haracter is a <, assume it's in XML formst.
         XML xml;
         if (bytes[0] == '<') {
             std::string str(std::begin(bytes), std::end(bytes));
@@ -188,14 +186,15 @@ client_handler(Tcpip &net)
                 xml.parseMem(str);
                 if (xml[0]->nameGet() == "helo") {
                     hostname = xml[0]->childGet(0)->valueGet();
-                    user = "foo";// xml[data]->childGet(1)->valueGet();
-                    BOOST_LOG(lg) << "Incoming connection from user " << user
-                                  << " on host " << hostname;
                 } else {
                     cmd.execCommand(xml, str);
-                    std::lock_guard<std::mutex> guard(queue_lock);
-                    tqueue.push(xml);
-                    queue_cond.notify_one();
+                    try {
+                        boost::asio::write(tcp_socket, buffer(str), error);
+                    } catch (const std::exception& e) {
+                        BOOST_LOG_SEV(lg, severity_level::error)
+                            << "Couldn't write data to PowerGuru server! " << 
e.what();
+                        exit(-1);
+                    }
                 }
                 str.clear();
             }
diff --git a/devices/serial.cc b/devices/serial.cc
index 3157ba3..d8076b3 100644
--- a/devices/serial.cc
+++ b/devices/serial.cc
@@ -1,5 +1,6 @@
 // 
-// Copyright (C) 2005, 2006 - 2018
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+//               2014, 2015, 2016, 2017, 2018, 2019
 //      Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
@@ -41,7 +42,9 @@
 #include "log.h"
 #include "serial.h"
 
-static src::logger lg;
+//static src::logger lg;
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
 
 // Set the names of the baud rates so we can dump them in a human
 // readable fashion.
@@ -136,7 +139,7 @@ Serial::~Serial(void)
 /// it can be read/write in raw mode.
 /// @param The full path to the serial port to open
 /// @return Whether the file could be opened or not
-retcode_t
+boost::system::error_code
 Serial::Open(std::string &filespec)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -177,17 +180,17 @@ Serial::Open(std::string &filespec)
     // set the timeout value for communications
     if (SetTimeout (20, errcond) == ERROR) {
         BOOST_LOG(lg) << "ERROR: Couldn't set the timeout value";
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
     DumpTtyState();
 #endif
 
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
 /// Close the serial port
 /// @return Whether the file could be closed or not
-retcode_t
+boost::system::error_code
 Serial::Close(void)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -202,18 +205,18 @@ Serial::Close(void)
     _uartfd = -1;
     uartfile = 0;
   
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
 
 /// Flush data in the serial port so it gets out
 ///
 /// @return Whether the file could be closed or not
-retcode_t
+boost::system::error_code
 Serial::Flush  (void)
 {
     tcflush(_uartfd, TCIOFLUSH);
 
-    return SUCCESS;               // FIXME: this should be a real check
+    errc::make_error_code(errc::success);               // FIXME: this should 
be a real check
 }
 
 
@@ -344,7 +347,7 @@ if ((sret == 0) && (ret <= 0)) {
 
 //seriallogfile << "<read>" << buf << "</read>" << std::endl;
 } else {
-      return ERROR;
+      errc::make_error_code(errc::not_supported);
   }
 #endif
 
@@ -386,7 +389,7 @@ Serial::Write(const char *buf, int nbytes) const
 ///
 /// @param The baud rate code as returned by rate_to_code()
 /// @return Whether the baud rate could be set
-retcode_t
+boost::system::error_code
 Serial::SetBaud (int baudcode)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -406,7 +409,7 @@ Serial::SetBaud (int baudcode)
     int ret = tcsetattr(_uartfd, TCSANOW, &ctty);
     if (ret == 0) {
         BOOST_LOG(lg) << __PRETTY_FUNCTION__ << " worked" << std::endl;
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     }
   
     seriallogfile << "<device><baud>\"" << serial_speeds[baudcode] << 
"\"</baud></device>" << std::endl;
@@ -419,19 +422,19 @@ Serial::SetBaud (int baudcode)
     BOOST_LOG(lg) << "Output baud is now set to " << serial_speeds[obaud] << 
std::endl;
 
     BOOST_LOG(lg) << __PRETTY_FUNCTION__ << " failed" << std::endl;
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
 
 #if 0
 /// @return Whether the file could be closed or not
-retcode_t
+boost::system::error_code
 Serial::send_break (struct errcond *err) const
 {
     DEBUGLOG_REPORT_FUNCTION;
     
     tcsendbreak (Device::fd, 0);
 
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 #endif
 
@@ -439,7 +442,7 @@ Serial::send_break (struct errcond *err) const
 ///
 /// @param 
 /// @return Whether the blocking mode could be changed
-retcode_t
+boost::system::error_code
 Serial::SetBlocking(bool mode)
 {
     tcgetattr(_uartfd, &currenttty);
@@ -451,7 +454,7 @@ Serial::SetBlocking(bool mode)
   
     tcsetattr(_uartfd, TCSANOW, &currenttty);
 
-    return SUCCESS;               // FIXME: this should be a real check
+    errc::make_error_code(errc::success);               // FIXME: this should 
be a real check
 }
 
 //  modem control lines
@@ -461,7 +464,7 @@ Serial::SetBlocking(bool mode)
 
 /// Set the DTR for the serial port
 /// @return Whether the DTR could be set
-retcode_t
+boost::system::error_code
 Serial::SetDTR (void)
 {
     return SetDTR(true);
@@ -471,7 +474,7 @@ Serial::SetDTR (void)
 ///
 /// @param What to set the DTR to
 /// @return Whether the DTR could be set
-retcode_t
+boost::system::error_code
 Serial::SetDTR (bool value)
 {
     int arg = 0;
@@ -492,12 +495,12 @@ Serial::SetDTR (bool value)
 
     ioctl(_uartfd, TIOCMSET, (unsigned long) &arg);
 
-    return SUCCESS;               // FIXME: this should be a real check
+    errc::make_error_code(errc::success);               // FIXME: this should 
be a real check
 }
 
 /// Set Raw mode for th serial port
 /// @return Whether the serial port could be set to raw mode
-retcode_t
+boost::system::error_code
 Serial::SetRaw (void)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -525,7 +528,7 @@ Serial::SetRaw (void)
   
     tcsetattr(_uartfd, TCSANOW, &currenttty);
 
-    return SUCCESS;               // FIXME: this should be a real check
+    errc::make_error_code(errc::success);               // FIXME: this should 
be a real check
 }
 
 void
diff --git a/devices/serial.h b/devices/serial.h
index 71bdaed..2b2dbb3 100644
--- a/devices/serial.h
+++ b/devices/serial.h
@@ -1,6 +1,7 @@
-// 
-// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
-// 2014, 2015 2016. 2017, 2018, 2019 Free Software Foundation, Inc.
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+//               2014, 2015, 2016, 2017, 2018, 2019
+//      Free Software Foundation, Inc.
 // 
 // 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
@@ -33,6 +34,8 @@
 #include <cstdio>
 
 #include <termios.h>
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
 
 //#define DEFAULT_UART "/dev/pts/12";
 #define DEFAULT_UART "/dev/ttyS0";
@@ -45,13 +48,13 @@ public:
     Serial (void);
 
     // Set the terminal to be in RAW mode
-    retcode_t SetRaw (void);
-    retcode_t SetDTR (void);
-    retcode_t SetDTR (bool value);
-    retcode_t SetBlocking(bool mode);    
+    boost::system::error_code SetRaw (void);
+    boost::system::error_code SetDTR (void);
+    boost::system::error_code SetDTR (bool value);
+    boost::system::error_code SetBlocking(bool mode);    
 
     // Set the baud rate
-    retcode_t SetBaud (int x);
+    boost::system::error_code SetBaud (int x);
 
     int GetFD() {
         return _uartfd;
@@ -64,12 +67,12 @@ public:
     termios *GetTtyState (void);
 
     // These methods operate on the serial port
-    retcode_t Open   (std::string &name);
-    retcode_t Close  (void);
+    boost::system::error_code Open   (std::string &name);
+    boost::system::error_code Close  (void);
     int Read   (char *buf, int nbytes);
     int Write  (const char *buf, int nbytes) const;
 
-    retcode_t Flush  (void);
+    boost::system::error_code Flush  (void);
 
     // These methods do byte oriented I/O on the serial port
     int Getc (void);
@@ -90,7 +93,6 @@ private:
     FILE           *uartfile;
     termios        origtty;
     termios        currenttty;
-    ErrCond        errcond;
 };
 
 // __SERIAL_H__
diff --git a/lib/msgs.cc b/lib/msgs.cc
index cf950ed..f8e670a 100644
--- a/lib/msgs.cc
+++ b/lib/msgs.cc
@@ -36,8 +36,6 @@
 #endif
 #include "log.h"
 #include "msgs.h"
-#include "tcputil.h"
-#include "tcpip.h"
 
 Msgs::net_mode_e  Msgs::_net_mode;
 std::map<const char *, Msgs::methodPtr_t> Msgs::_methods;
diff --git a/lib/msgs.h b/lib/msgs.h
index f4e9a98..a8f5f42 100644
--- a/lib/msgs.h
+++ b/lib/msgs.h
@@ -36,9 +36,8 @@
 #ifdef HAVE_LIBXML
 # include "xml.h"
 #endif
-#include "tcpip.h"
 
-class Msgs : public Tcpip {
+class Msgs {
 public:
 
     typedef enum {
diff --git a/lib/rc.cc b/lib/rc.cc
index 0e7686a..b01be32 100644
--- a/lib/rc.cc
+++ b/lib/rc.cc
@@ -1,5 +1,6 @@
 // 
-// Copyright (C) 2005, 2006 - 2018
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+//               2014, 2015, 2016, 2017, 2018, 2019
 //      Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
@@ -27,7 +28,6 @@
 #include <cstring>
 #include <iostream>
 #include <fstream>
-#include <boost/system/error_code.hpp>
 
 #include "log.h"
 #include "rc.h"

http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=cc09b278b108d53578d8798da05690c09bb571f1


commit cc09b278b108d53578d8798da05690c09bb571f1
Author: Rob Savoye <address@hidden>
Date:   Sat Jan 12 18:18:34 2019 -0700

    Using boost networking now

diff --git a/testsuite/libtests/tcpip-test.cc b/testsuite/libtests/tcpip-test.cc
deleted file mode 100644
index 9444ea0..0000000
--- a/testsuite/libtests/tcpip-test.cc
+++ /dev/null
@@ -1,304 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006-2018 Free Software Foundation, Inc.
-//
-//   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 2 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, write to the Free Software
-//   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-// This is generated by autoconf
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdarg.h>
-#include <signal.h>
-#include <netinet/in.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/types.h>
-#include <cstdio>
-#include <iostream>
-
-#include "dejagnu.h"
-#include "tcpip.h"
-
-int verbosity;
-static void usage (void);
-bool waitforgdb = false;
-static void cntrlc_handler (int);
-static void alarm_handler (int);
-static bool loop = true;
-
-int
-start_proc (const std::string &procname);
-
-TestState runtest;
-class Test : public Tcpip
-{
-public:
-    Test(void) {
-        // Get some system information needed to test the classes.
-        std::memset(_thost, 0, MAXHOSTNAMELEN);
-        if (gethostname(_thost, MAXHOSTNAMELEN) != 0) {
-            std::cerr << "ERROR: gethostname() failed!" << std::endl;
-            exit(-1);
-        } 
-        if (_thost == 0) {
-            std::cerr << "ERROR: gethostbyname() failed!" << std::endl;
-            exit(-1);        
-        }
-        _tservice = getservbyname("git", NULL);
-        if (_tservice == 0) {
-            std::cerr << "ERROR: getservbyname() failed!" << std::endl;
-            exit(-1);        
-        }
-    };
-
-    ~Test(void) {
-    };
-
-    int test(void) {
-        // See if we can do service lookups
-        _tservice = lookupService("powerguru", "tcp");
-        if (_tservice != 0) {
-            if (strcmp(_tservice->s_name, "powerguru") == 0 &&
-                strcmp(_tservice->s_proto, "tcp") == 0 &&
-                _tservice->s_port == htons(7654))
-                runtest.pass ("lookupService(powerguru)");
-            else
-                runtest.fail ("lookupService(powerguru)");
-        } else {
-            runtest.fail ("lookupService(powerguru)");
-        }
-
-        createNetServer(7654);
-        int pid = start_proc("./childtcpip");
-
-        // sleep so the child process has time to run, and we have time
-        // to debug it. We setup a handler for ^C, so we can get out of
-        // this sleep when we're done.
-        if (waitforgdb) {
-            struct sigaction  act2;
-            act2.sa_handler = cntrlc_handler;
-            sigaction (SIGINT, &act2, NULL);
-            sleep(300);
-        } else {
-            sleep(1);
-        }
-
-        int retries = 3;
-        while (retries-- > 0) {
-            retcode_t ts = newNetConnection(true);
-            if (ts) {
-                break;
-            } else {
-                // Under purify, things are very slow, so wait before retries
-                sleep(10);
-            }
-        }
-        struct sigaction  act;
-        act.sa_handler = alarm_handler;
-        sigaction (SIGALRM, &act, NULL);
-        alarm(5);
-        std::cout << std::endl
-             << "Waiting 5 seconds for input from the child process..." << 
std::endl;
-
-        // Read data from the child process
-        std::vector<unsigned char> data;
-        readNet(data);
-        if (data.size() > 0) {
-            runtest.pass("Established network connection from client");
-        } else {
-            runtest.fail("Established network connection from client");
-        }
-
-        writeNet("done");
-        closeNet();
-    };
-
-protected:
-    char                   _thost[MAXHOSTNAMELEN];
-    const struct servent  *_tservice;
-    const struct protoent *_tproto;
-    const in_addr_t       *_taddr;
-};
-
-int
-main(int argc, char *argv[])
-{
-    int c;
-    bool dump = false;
-    std::string filespec;
-    std::string procname, memname;
-    char buffer[300];
-
-    memset(buffer, 0, 300);
-    
-    while ((c = getopt (argc, argv, "hdvsm:")) != -1) {
-        switch (c) {
-          case 'h':
-            usage ();
-            break;
-            
-          case 'd':
-            dump = true;
-            break;
-            
-          case 's':
-            waitforgdb = true;
-            break;
-                                                                               
 
-          case 'v':
-            verbosity++;
-            break;
-            
-          case 'm':
-            memname = optarg;
-            std::cerr << "Open " << memname << std::endl;
-            break;
-            
-          default:
-            usage ();
-            break;
-        }
-    }
-    
-    // get the file name from the command line
-    if (optind < argc) {
-        filespec = argv[optind];
-        std::cout << "Will use \"" << filespec << "\" for test " << std::endl;
-    }
-
-    Test test;
-    test.test();
-    
-#if 0    
-    // See if we can do service lookups
-    service = tcpip.lookupService("powerguru", "tcp");
-    if (service != 0) {
-        if (strcmp(service->s_name, "powerguru") == 0 &&
-            strcmp(service->s_proto, "tcp") == 0 &&
-            service->s_port == htons(7654))
-            runtest.pass ("Tcpip::lookupService(powerguru)");
-        else
-            runtest.fail ("Tcpip::lookupService(powerguru)");
-    } else {
-        runtest.fail ("Tcpip::lookupService(powerguru)");
-    }
-    
-//    tcpip.toggleDebug(true);
-    // See if we can do protocol lookups
-    proto = tcpip.protoDataGet();
-    if (proto != 0) {
-        if (strcmp(proto->p_name, "tcp") == 0 &&
-            proto->p_proto == 6) {
-            runtest.pass ("Tcpip::protoDataGet()");
-        } else {
-            runtest.fail ("Tcpip::protoDataGet()");
-        }
-    } else {
-        runtest.fail ("Tcpip::protoDataGet()");    
-    }
-    if (tcpip.protoNameGet() == "tcp") {
-        runtest.pass ("Tcpip::protoNameGet()");
-    } else {
-        runtest.fail ("Tcpip::protoNameGet()");
-    }
-    if (tcpip.protoNumGet() == 6) {
-        runtest.pass ("Tcpip::protoNumGet()");
-    } else {
-        runtest.fail ("Tcpip::protoNumGet()");
-    }
-#endif
-    
-}
-// Run the tests between two processes
-int
-start_proc (const std::string &procname)
-{
-    struct stat procstats;
-    char *cmd_line[5];
-    pid_t childpid;
-    int ret = 0;
-    
-    // See if the file actually exists, otherwise we can't spawn it
-    if (stat(procname.c_str(), &procstats) == -1) {
-        std::cerr << "Invalid filename \"" << procname << "\"" << std::endl;
-        perror(procname.c_str());
-        return -1;
-    }
-    
-    // setup a command line. By default, argv[0] is the name of the process
-    memset(cmd_line, 0, sizeof(char *)*5);
-    cmd_line[0] = new char(50);
-    strcpy(cmd_line[0], procname.c_str());
-    if (waitforgdb) {
-        cmd_line[1] = new char(3);
-        strcpy(cmd_line[1], "-s");
-    }
- 
-    // fork ourselves silly
-    childpid = fork();
-    
-    
-    // childpid is a positive integer, if we are the parent, and fork() worked
-    if (childpid > 0) {
-        std::cerr << "Forked sucessfully, child process PID is " << childpid 
<< std::endl;
-        return childpid;
-    }
-    
-    // childpid is -1, if the fork failed, so print out an error message
-    if (childpid == -1) {
-        perror(procname.c_str());
-        return -1;
-    }
-    
-    // If we are the child, exec the new process, then go away
-    if (childpid == 0) {
-        // Start the desired executable
-        std::cout << "Starting " << procname << " with " << cmd_line[0] << 
std::endl;
-        ret = execv(procname.c_str(), cmd_line);
-        perror(procname.c_str());
-        exit(0);
-    }
-    return 0;
-}
- 
-void
-cntrlc_handler (int sig)
-{
-    std::cerr << "Got a ^C !" << std::endl;
-}
-
-void
-alarm_handler (int sig)
-{
-  std::cerr << "Got an alarm signal !" << std::endl;
-  std::cerr << "This is OK, we use it to end this test case." << std::endl;
-  loop = false;
-}
-
-static void
-usage (void)
-{
-    std::cerr << "This program tests the Global memory system." << std::endl;
-    std::cerr << "Usage: tglobal [h] filename" << std::endl;
-    std::cerr << "-h\tHelp" << std::endl;
-    std::cerr << "-d\tDump parsed data" << std::endl;
-    exit (-1);
-}
diff --git a/testsuite/libtests/tcputil-test.cc 
b/testsuite/libtests/tcputil-test.cc
deleted file mode 100644
index 34476de..0000000
--- a/testsuite/libtests/tcputil-test.cc
+++ /dev/null
@@ -1,186 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006-2018
-//   Free Software Foundation, Inc.
-//
-//   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 2 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, write to the Free Software
-//   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-// This is generated by autoconf
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdarg.h>
-#include <signal.h>
-#include <netinet/in.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/types.h>
-#include <cstdio>
-#include <iostream>
-#include <netdb.h>
-#include <sys/utsname.h>
-
-#include "dejagnu.h"
-
-#include "tcputil.h"
-#include "tcpip.h"
-
-using namespace std;
-
-int verbosity;
-static void usage (void);
-
-TestState runtest;
-const short DEFAULTPORT  = 7654;
-
-class Test : public Tcputil
-{
-public:
-    Test(void) {
-        // Get some system information needed to test the classes.
-        std::memset(_thost, 0, MAXHOSTNAMELEN);
-        if (gethostname(_thost, MAXHOSTNAMELEN) != 0) {
-            std::cerr << "ERROR: gethostname() failed!" << std::endl;
-            exit(-1);
-        }
-        
-        if (_thost == 0) {
-            std::cerr << "ERROR: gethostbyname() failed!" << std::endl;
-            exit(-1);        
-        }
-        
-        _tservice = getservbyname("git", NULL);
-        if (_tservice == 0) {
-            std::cerr << "ERROR: getservbyname() failed!" << std::endl;
-            exit(-1);        
-        }
-    };
-    
-    int test(void) {
-        if (numberOfInterfaces() >= 2) {
-            runtest.pass ("Tcputil::numberOfInterfaces()");
-        } else {
-            runtest.fail ("Tcputil::numberOfInterfaces()");  
-        }
-
-        // Check the defaults
-        if (_hostname != _thost && _hostname == "localhost") {
-            runtest.pass ("Hostname is correct");
-        } else {
-            runtest.fail ("Hostname is not correct");
-        }
-
-        if (_service == 0) {
-            runtest.pass ("Service is correctly empty");
-        } else {
-            runtest.unresolved ("Service is not correctly empty");
-        }
-        
-        // See if we can do service lookups
-        struct servent *serv = lookupService("ftp", "tcp");
-        
-        if (strcmp(serv->s_name, "ftp") == 0 &&
-            strcmp(serv->s_proto, "tcp") == 0 &&
-            serv->s_port == ntohs(21)) {
-            runtest.pass ("Tcputil::lookupService(ftp)");
-        } else {
-            runtest.fail ("Tcputil::lookupService(ftp)");
-        }
-
-        struct addrinfo *addr;
-        if (addr = getAddrInfo()) {
-            runtest.pass ("Tcputil::getAddrInfo()");
-        } else {
-            runtest.fail ("Tcputil::getAddrInfo()");
-        }
-
-        std::string str;
-        if (printIP(addr, str) == "127.0.0.1") {
-            runtest.pass ("Tcputil::printIP()");
-        } else {
-            runtest.fail ("Tcputil::printIP()");
-        }
-
-        if (addr = getAddrInfo("gnu.org")) {
-            runtest.pass ("Tcputil::getAddrInfo(gnu.org)");
-        } else {
-            runtest.fail ("Tcputil::getAddrInfo(gnu.org)");
-        }
-        
-        dump();
-    };
-    
-    ~Test(void) {
-    };
-    
-protected:
-    char                   _thost[MAXHOSTNAMELEN];
-    const struct servent  *_tservice;
-    const struct protoent *_tproto;
-    const in_addr_t       *_taddr;
-};
-
-int
-main(int argc, char *argv[])
-{
-    int c;
-    bool dump = false;
-    string filespec;
-    string procname, memname;
-    
-    while ((c = getopt (argc, argv, "hdv")) != -1) {
-        switch (c) {
-          case 'h':
-            usage ();
-            break;
-            
-          case 'd':
-            dump = true;
-            break;
-            
-          case 'v':
-            verbosity++;
-            break;
-            
-          default:
-            usage ();
-            break;
-        }
-    }
-    
-    // get the file name from the command line
-    if (optind < argc) {
-        filespec = argv[optind];
-        cout << "Will use \"" << filespec << "\" for test " << endl;
-    }
-
-    Test test;
-    test.test();    
-}
-
-static void
-usage (void)
-{
-    cerr << "This program tests the Global memory system." << endl;
-    cerr << "Usage: tcputil [h] filename" << endl;
-    cerr << "-h\tHelp" << endl;
-    cerr << "-d\tDump parsed data" << endl;
-    exit (-1);
-}

http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=e654bf5acbf6876b7069b7c07d05caf01788b299


commit e654bf5acbf6876b7069b7c07d05caf01788b299
Author: Rob Savoye <address@hidden>
Date:   Sat Jan 12 18:05:53 2019 -0700

    Replace crufty ErrCond with Boost weeor codes

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 95f181a..0859195 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -40,9 +40,9 @@ libpguru_la_SOURCES = \
        rc.cc rc.h \
        log.cc log.h \
        console.cc console.h \
-       database.h \
-       tcputil.cc tcputil.h \
-       tcpip.cc tcpip.h
+       database.h
+#      tcputil.cc tcputil.h \
+#      tcpip.cc tcpip.h
 
 if BUILD_OUTBACK
 libpguru_la_SOURCES += msgs.cc msgs.h menuitem.cc menuitem.h
@@ -76,15 +76,10 @@ noinst_HEADERS = \
        menuitem.h \
        database.h \
        console.h \
-       err.h \
        log.h \
-       tcputil.h \
-       tcpip.h \
        msgs.h \
        xml.h
 
-#libpguru_la_LDFLAGS = -module -avoid-version -no-undefined
-
 clean-hook:
        -rm -f core.*
 
diff --git a/lib/commands.cc b/lib/commands.cc
index 6c528c8..096400b 100644
--- a/lib/commands.cc
+++ b/lib/commands.cc
@@ -1,5 +1,5 @@
 // 
-// Copyright (C) 2018
+// Copyright (C) 2018, 2019
 //      Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
@@ -57,25 +57,47 @@ std::string &
 Commands::createNode(cmd_t cmd, const std::string &args,
                                std::string &str)
 {
+    DEBUGLOG_REPORT_FUNCTION;
+
+    return str;
+}
+
+/// createCommand
+/// @param cmd The command
+/// @param args Arguments to the command, separated by spaces
+/// @param str The string to hold the result
+/// @returns The XML for this command
+std::string &
+Commands::createCommand(cmd_t cmd, const std::string &args,
+                        std::string &str)
+{
     //DEBUGLOG_REPORT_FUNCTION;
 
+    if (cmd != RESULT) {
+        str = "<command>";
+    }
+
     switch (cmd) {
       case LIST:
-          BOOST_LOG(lg) << "create LIST command" << std::endl;
+          BOOST_LOG_SEV(lg, severity_level::debug) << "create LIST command: " 
<< args;
           str += "<list>" + args + "</list>";
           break;
       case POLL:
-          BOOST_LOG(lg) << "create POLL command" << std::endl;  
+          BOOST_LOG_SEV(lg, severity_level::debug) << "create POLL command: " 
<< args;
           str += "<poll>" + args + "</poll>";
           break;
       case NOP:
-          BOOST_LOG(lg) << "create NOP command" << std::endl;  
+          BOOST_LOG_SEV(lg, severity_level::debug) << "create NOP command: " 
<< args;
           str += "<nop>" + args + "</nop>";
           break;
+      case RESULT:
+          BOOST_LOG_SEV(lg, severity_level::debug) << "create RESULT command: 
" << args;
+          str += "<result>" + args + "</result>";
+          break;
       case HELO:
           // This takes two optional arguments, the first one
           // is the hostname, the second the user name.
-          BOOST_LOG(lg) << "create HELO command" << std::endl;
+          BOOST_LOG_SEV(lg, severity_level::debug) << "create HELO command: " 
<< args;
           std::string data = "<hostname>";
           size_t pos = args.find(' ');
           if (pos == std::string::npos) {
@@ -93,40 +115,31 @@ Commands::createNode(cmd_t cmd, const std::string &args,
           str += "<helo>" + data + "</helo>";
           break;
     };
+    if (cmd != RESULT) {
+        str += "</command>\n";
+    }
     
     return str;
 }
 
 std::string &
-Commands::createCommand(cmd_t cmd, const std::string &args,
-                        std::string &str)
-{
-    //DEBUGLOG_REPORT_FUNCTION;
-    
-    std::string newstr = "<command>";
-    newstr += str;
-    newstr += "</command>\n";
-    str = newstr;
-
-    return str;
-}
-
-std::string &
 Commands::execCommand(XML &xml, std::string &str)
 {
     DEBUGLOG_REPORT_FUNCTION;
 
     std::string cmd = xml.nameGet();
     
-    BOOST_LOG(lg) << "Executing remote command " << cmd << std::endl;
+    BOOST_LOG(lg) << "Executing remote command " << cmd;
 
     // The first child node is the top level command
-    if (xml[0]->nameGet() == "list") {
-        if (xml[0]->valueGet() == "devices") {
-            // FIXME:
-        }
-    }
+    //if (xml[0]->nameGet() == "list") {
+        //if (xml[0]->valueGet() == "devices") {
+        //     // FIXME:
+        //}
+        //}
 
+    createCommand(RESULT, "Iko Iko", str);
+    
     return str;
 }
 
diff --git a/lib/commands.h b/lib/commands.h
index 2b8ffe4..f8f852d 100644
--- a/lib/commands.h
+++ b/lib/commands.h
@@ -32,7 +32,7 @@
 class Commands 
 {
 public:
-    typedef enum { NOP, LIST, POLL, HELO } cmd_t; 
+    typedef enum { NOP, LIST, POLL, HELO, RESULT } cmd_t; 
     Commands();
     ~Commands();
     std::string &createNode(cmd_t cmd, const std::string &args,
diff --git a/lib/console.h b/lib/console.h
index 0ec1c5b..09b221f 100644
--- a/lib/console.h
+++ b/lib/console.h
@@ -26,7 +26,8 @@
 #include <vector>
 #include <cstdio>
 #include <termios.h>
-#include "err.h"
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
 
 class Console {
 public:
@@ -60,7 +61,6 @@ public:
     // write a string to the console
     int putsCon (std::string out) { return putsCon (out.c_str(), 
outchannel.fhandle); }
     int putsCon (std::string out, FILE *y)  { return fputs(out.c_str(), y); }
-    int putsCon (ErrCond &Err)  { return fputs(Err.GetMsg().c_str(), 
outchannel.fhandle); }
  
     // Accessors
 
diff --git a/lib/database.h b/lib/database.h
index c5a60fc..7f7abc4 100644
--- a/lib/database.h
+++ b/lib/database.h
@@ -102,6 +102,8 @@ public:
         _ftable[MOISTURE] = "MOISTURE";
         _ftable[UNSUPPORTED] = "UNSUPORTED";
 
+        initTable(_family);
+
         // These values may be replaced on the command line. These are the
         // default behaviour.
         _tblname  = DBTABLE;
diff --git a/lib/msgs.cc b/lib/msgs.cc
index 5075000..cf950ed 100644
--- a/lib/msgs.cc
+++ b/lib/msgs.cc
@@ -26,6 +26,7 @@
 #include <cstring>
 #include <iterator>
 #include <map>
+#include <boost/system/error_code.hpp>
 # include <sstream>
 #ifdef HAVE_LIBXML
 # include <libxml/encoding.h>
@@ -86,7 +87,7 @@ Msgs::Msgs(Tcpip *tcpip)//  : _net_mode(NONET)
     _version = atof(VERSION);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::init(net_mode_e mode)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -98,7 +99,7 @@ Msgs::init(net_mode_e mode)
         if (createNetClient(hostname)) {
             BOOST_LOG(lg) << "Connected to server at " << hostname.c_str() << 
std::endl;
             init();                     // initialize the table of pointers
-            return SUCCESS;
+            errc::make_error_code(errc::success);
         } else {
             BOOST_LOG(lg) << "ERROR: Couldn't create connection to server" << 
hostname.c_str()  << std::endl;
         }
@@ -110,11 +111,11 @@ Msgs::init(net_mode_e mode)
         BOOST_LOG(lg) << "ERROR: no mode specified! " << std::endl;
         _net_mode = NONET;
     }
-    return ERROR;  
+    errc::make_error_code(errc::not_supported);  
 }
 
 // If a hostname is specifed, we force client mode.
-retcode_t
+boost::system::error_code
 Msgs::init(net_mode_e mode, const std::string &hostname)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -123,7 +124,7 @@ Msgs::init(net_mode_e mode, const std::string &hostname)
 
 // By default, if just a hostname is supplied, we assume it's to establish
 // a network connection to the specified host.
-retcode_t
+boost::system::error_code
 Msgs::init(const std::string &hostname)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -133,14 +134,14 @@ Msgs::init(const std::string &hostname)
         init();                     // initialize the table of pointers
         _net_mode = CLIENT;
         writeNet(heloCreate(_version));
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     } else {
         BOOST_LOG(lg) << "ERROR: Couldn't create connection to server" << 
hostname  << std::endl;
     }
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::init(net_mode_e mode, bool block)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -150,7 +151,7 @@ Msgs::init(net_mode_e mode, bool block)
         if (createNetClient(hostname)) {
             BOOST_LOG(lg) << "Connected to server at " << hostname.c_str() << 
std::endl;
             init();                     // initialize the table of pointers
-            return SUCCESS;
+            errc::make_error_code(errc::success);
         } else {
             BOOST_LOG(lg) << "ERROR: Couldn't create connection to server" << 
hostname.c_str()  << std::endl;
         }
@@ -162,10 +163,10 @@ Msgs::init(net_mode_e mode, bool block)
         BOOST_LOG(lg) << "ERROR: no mode specified! " << std::endl;
         _net_mode = NONET;
     }
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
                
-retcode_t
+boost::system::error_code
 Msgs::init(bool block)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -182,15 +183,15 @@ Msgs::init(bool block)
         BOOST_LOG(lg) << "New connection started for remote client." << 
std::endl;
         _net_mode = DAEMON;
         writeNet(heloCreate(_version));
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     } else {
         BOOST_LOG(lg) << "ERROR: Couldn't create a new connection!" << 
std::endl;
     }
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
 
   
-retcode_t
+boost::system::error_code
 Msgs::init(void)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -268,7 +269,7 @@ Msgs::init(void)
         _cache[ "sell-amps"] = "444444444444";
     }
   
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
 std::string &
@@ -303,14 +304,14 @@ Msgs::cacheGet(const std:;string &name) {
 #endif
 }
 
-retcode_t
+boost::system::error_code
 Msgs::cacheAdd(const std::string &name, const std::string &str)
 {
     // DEBUGLOG_REPORT_FUNCTION;
     _cache[name] = str;
 
     // FIXME: we should make sure this actually worked.
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
 
@@ -356,7 +357,7 @@ Msgs::methodGet(const std::string &name)
 }
 
 // Call the function to process an XML node
-retcode_t
+boost::system::error_code
 Msgs::methodProcess(const std::string &name, XMLNode &node)
 {
     // DEBUGLOG_REPORT_FUNCTION;
@@ -420,7 +421,7 @@ Msgs::~Msgs()
   
 }
 
-retcode_t
+boost::system::error_code
 Msgs::unimplementedProcess(XMLNode *xml)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -437,9 +438,9 @@ Msgs::unimplementedProcess(XMLNode *xml)
     _body << ends;
 
     if (writeNet(_body.str())) {
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     } else {
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     }
 }
 
@@ -449,7 +450,7 @@ Msgs::process(XMLNode *xml)
     DEBUGLOG_REPORT_FUNCTION;
     methodPtr_t   fptr;
     const char *str;
-    retcode_t     ret;
+    boost::system::error_code     ret;
     int           i;
 
     str = xml->nameGet();
@@ -1000,7 +1001,7 @@ Msgs::print_msg(std::string msg)
 }
 
 // These parse incoming messages for the daemon
-retcode_t
+boost::system::error_code
 Msgs::statusProcess(XMLNode &node)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -1026,15 +1027,15 @@ Msgs::statusProcess(XMLNode &node)
         }
     
         if (writeNet(str)) {
-            return ERROR;
+            errc::make_error_code(errc::not_supported);
         } else {
-            return SUCCESS;
+            errc::make_error_code(errc::success);
         }
     }
 
     if (_net_mode == CLIENT) {
         if (strcmp(node->nameGet(),  "status") == 0) {
-            return SUCCESS;
+            errc::make_error_code(errc::success);
         }
 
 #if 0
@@ -1054,22 +1055,22 @@ Msgs::statusProcess(XMLNode &node)
         cacheAdd(node->nameGet(), node->valueGet());
         BOOST_LOG(lg) << "tag \"" << node->nameGet() << "\" has a value of: " 
<< node->valueGet() << std::endl;
     
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     }
   
-    return ERROR;                 // FIXME: implement this method
+    errc::make_error_code(errc::not_supported);                 // FIXME: 
implement this method
 }
 
-retcode_t
+boost::system::error_code
 Msgs::heloProcess(XMLNode &node)
 {
     DEBUGLOG_REPORT_FUNCTION;
     BOOST_LOG(lg) << "WARNING: unimplemented method" << std::endl;
   
-    return ERROR;                 // FIXME: implement this method
+    errc::make_error_code(errc::not_supported);                 // FIXME: 
implement this method
 }
 
-retcode_t
+boost::system::error_code
 Msgs::configProcess(XMLNode &node)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -1077,7 +1078,7 @@ Msgs::configProcess(XMLNode &node)
     return unimplementedProcess(node);    // FIXME: implement this method
 }
 
-retcode_t
+boost::system::error_code
 Msgs::metersProcess(XMLNode &node)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -1098,9 +1099,9 @@ Msgs::metersProcess(XMLNode &node)
   
         std::string str = metersResponseCreate(node->valueGet(), value);
         if (writeNet(str)) {
-            return ERROR;
+            errc::make_error_code(errc::not_supported);
         } else {
-            return SUCCESS;
+            errc::make_error_code(errc::success);
         }
     }
 
@@ -1109,10 +1110,10 @@ Msgs::metersProcess(XMLNode &node)
         // Process the result
     }
 
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::serverProcess(XMLNode &node)
 {
     //  DEBUGLOG_REPORT_FUNCTION;
@@ -1127,21 +1128,21 @@ Msgs::serverProcess(XMLNode &node)
                        << "\" with a value of " << attr->valueGet() << 
std::endl;
             if (strcmp(attr->valueGet(), (const char *)_thisip.c_str()) != 0) {
                 BOOST_LOG(lg) << "WARNING: IP's don't match!!!!" << std::endl;
-                return ERROR;
+                errc::make_error_code(errc::not_supported);
             }
         }
     }
 
     if (strcmp(node->valueGet(), (const char *)_thishost.c_str()) != 0) {
         BOOST_LOG(lg) << "WARNING: Host's don't match!!!!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
 
     BOOST_LOG(lg) << "Host and IP data match" << std::endl;
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::clientProcess(XMLNode &node)
 {
     // DEBUGLOG_REPORT_FUNCTION;
@@ -1157,7 +1158,7 @@ Msgs::clientProcess(XMLNode &node)
                            << "\" with a value of " << attr->valueGet() << 
std::endl;
                 if (strcmp(attr->valueGet(), (const char *)_remoteip.c_str()) 
!= 0) {
                     BOOST_LOG(lg) << "WARNING: IP's don't match!!!!" << 
std::endl;
-                    return ERROR;
+                    errc::make_error_code(errc::not_supported);
                 }
             }
         }
@@ -1166,15 +1167,15 @@ Msgs::clientProcess(XMLNode &node)
     if (_remotehost.size() != 0) {
         if (strcmp(node->valueGet(), (const char *)_remotehost.c_str()) != 0) {
             BOOST_LOG(lg) << "WARNING: Host's don't match!!!!" << std::endl;
-            return ERROR;
+            errc::make_error_code(errc::not_supported);
         }
     }
 
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
 // Process the top level header tag.
-retcode_t
+boost::system::error_code
 Msgs::powerguruProcess(XMLNode &node)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -1198,10 +1199,10 @@ Msgs::powerguruProcess(XMLNode &node)
         }
     }
 
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::chargeAmpsProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1210,13 +1211,13 @@ Msgs::chargeAmpsProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::loadAmpsProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1225,27 +1226,27 @@ Msgs::loadAmpsProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        //    return ERROR;
+        //    errc::make_error_code(errc::not_supported);
     }
   
     if (_net_mode == CLIENT) {
         BOOST_LOG(lg) << "Battery voltage is: " << node->valueGet() << 
std::endl;
     
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     }
 
 #if 0
     if (_net_mode == DAEMON) {
         std::string str = metersResponseCreate(node->valueGet(), 
_cache[node->nameGet()]);
     
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     }
 #endif
     
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::pvAmpsProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1254,13 +1255,13 @@ Msgs::pvAmpsProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::pvVoltsProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1269,13 +1270,13 @@ Msgs::pvVoltsProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::dailyKwhProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1284,13 +1285,13 @@ Msgs::dailyKwhProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::hertzProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1299,13 +1300,13 @@ Msgs::hertzProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::batteryVoltsProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1314,27 +1315,27 @@ Msgs::batteryVoltsProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        //    return ERROR;
+        //    errc::make_error_code(errc::not_supported);
     }
 
     if (_net_mode == CLIENT) {
         BOOST_LOG(lg) << "Battery voltage is: " << node->valueGet() << 
std::endl;
     
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     }
 
 #if 0
     if (_net_mode == DAEMON) {
         std::string str = metersResponseCreate(node->valueGet(), 
_cache[node->nameGet()]);
     
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     }
 #endif
     
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::buyAmpsProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1343,13 +1344,13 @@ Msgs::buyAmpsProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::sellAmpsProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1358,13 +1359,13 @@ Msgs::sellAmpsProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::acVoltsOutProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1373,13 +1374,13 @@ Msgs::acVoltsOutProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
   
-retcode_t
+boost::system::error_code
 Msgs::ac1InProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1388,13 +1389,13 @@ Msgs::ac1InProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::ac2InProcess(XMLNode &node) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -1403,13 +1404,13 @@ Msgs::ac2InProcess(XMLNode &node) {
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
       
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 Msgs::findTag(std::string tag)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -1419,13 +1420,13 @@ Msgs::findTag(std::string tag)
 
     _body << "<" << tag << ">";
     if ((pos = tag.find(_body.str(), 0)) != std::string::npos) {
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     }
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
 
 
-retcode_t
+boost::system::error_code
 Msgs::commandProcess(XMLNode &node)
 {
     DEBUGLOG_REPORT_FUNCTION;
@@ -1436,7 +1437,7 @@ Msgs::commandProcess(XMLNode &node)
       
     if (node->valueGet() <= 0) {
         BOOST_LOG(lg) << "ERROR: no value in messages!" << std::endl;
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
 
     _body.str("");
@@ -1458,23 +1459,23 @@ Msgs::commandProcess(XMLNode &node)
             str = responseCreate(RESPONSE, node->valueGet(), "foobar");
         }
         if (writeNet(str + "\r\n")) {
-            return ERROR;
+            errc::make_error_code(errc::not_supported);
         } else {
-            return SUCCESS;
+            errc::make_error_code(errc::success);
         }
     }
 
     if (_net_mode == CLIENT) {
         if (strcmp(node->nameGet(), "command") == 0) {
-            return SUCCESS;
+            errc::make_error_code(errc::success);
         }
         cacheAdd(node->nameGet(), node->valueGet());
         BOOST_LOG(lg) << "tag \"" << node->nameGet() << "\" has a value of: " 
<< node->valueGet() << std::endl;
     
-        return SUCCESS;
+        errc::make_error_code(errc::success);
     }
 
-    return ERROR;  
+    errc::make_error_code(errc::not_supported);  
 }
 
 // local Variables:
diff --git a/lib/msgs.h b/lib/msgs.h
index bd90a92..f4e9a98 100644
--- a/lib/msgs.h
+++ b/lib/msgs.h
@@ -29,10 +29,10 @@
 #include <cstring>
 #include <map>
 #include <sstream>
+#include <boost/system/error_code.hpp>
 
 #include "database.h"
 #include "log.h"
-#include "err.h"
 #ifdef HAVE_LIBXML
 # include "xml.h"
 #endif
@@ -98,7 +98,7 @@ public:
         RESPONSE
     } xml_msg_e;
   
-    typedef retcode_t (Msgs::*methodPtr_t)(XMLNode *node);
+    typedef boost::system::error_code (Msgs::*methodPtr_t)(XMLNode *node);
 
 //   struct msg_data 
 //   {
@@ -111,45 +111,45 @@ public:
     Msgs(Tcpip *tcpip);
     ~Msgs();
 
-    retcode_t init(void);
-    retcode_t init(net_mode_e);
-    retcode_t init(std::string &);
-    retcode_t init(net_mode_e, const std::string &);
-    retcode_t init(bool);
-    retcode_t init(net_mode_e, bool);
+    boost::system::error_code init(void);
+    boost::system::error_code init(net_mode_e);
+    boost::system::error_code init(std::string &);
+    boost::system::error_code init(net_mode_e, const std::string &);
+    boost::system::error_code init(bool);
+    boost::system::error_code init(net_mode_e, bool);
   
     void dump(XMLNode &);
     void process(const XMLNode &node);
     
     // These parse incoming messages for the daemon
-    retcode_t statusProcess(const XMLNode &node);
-    retcode_t powerguruProcess(const XMLNode &node);
+    boost::system::error_code statusProcess(const XMLNode &node);
+    boost::system::error_code powerguruProcess(const XMLNode &node);
   
-    retcode_t heloProcess(const XMLNode &node);
-    retcode_t serverProcess(const XMLNode &node);
-    retcode_t clientProcess(const XMLNode &node);
+    boost::system::error_code heloProcess(const XMLNode &node);
+    boost::system::error_code serverProcess(const XMLNode &node);
+    boost::system::error_code clientProcess(const XMLNode &node);
   
-    retcode_t configProcess(const XMLNode &node);
+    boost::system::error_code configProcess(const XMLNode &node);
 
     // These are all the tags associated with meters
-    retcode_t metersProcess(const XMLNode &node);
-    retcode_t chargeAmpsProcess(const XMLNode &node);
-    retcode_t loadAmpsProcess(const XMLNode &node);
-    retcode_t pvAmpsProcess(const XMLNode &node);
-    retcode_t pvVoltsProcess(const XMLNode &node);
-    retcode_t dailyKwhProcess(const XMLNode &node);
-    retcode_t hertzProcess(const XMLNode &node);
-    retcode_t batteryVoltsProcess(const XMLNode &node);
-    retcode_t buyAmpsProcess(const XMLNode &node);
-    retcode_t sellAmpsProcess(const XMLNode &node);
-    retcode_t acVoltsOutProcess(const XMLNode &node);
-    retcode_t ac1InProcess(const XMLNode &node);
-    retcode_t ac2InProcess(const XMLNode &node);
-
-    retcode_t unimplementedProcess(const XMLNode &node);
+    boost::system::error_code metersProcess(const XMLNode &node);
+    boost::system::error_code chargeAmpsProcess(const XMLNode &node);
+    boost::system::error_code loadAmpsProcess(const XMLNode &node);
+    boost::system::error_code pvAmpsProcess(const XMLNode &node);
+    boost::system::error_code pvVoltsProcess(const XMLNode &node);
+    boost::system::error_code dailyKwhProcess(const XMLNode &node);
+    boost::system::error_code hertzProcess(const XMLNode &node);
+    boost::system::error_code batteryVoltsProcess(const XMLNode &node);
+    boost::system::error_code buyAmpsProcess(const XMLNode &node);
+    boost::system::error_code sellAmpsProcess(const XMLNode &node);
+    boost::system::error_code acVoltsOutProcess(const XMLNode &node);
+    boost::system::error_code ac1InProcess(const XMLNode &node);
+    boost::system::error_code ac2InProcess(const XMLNode &node);
+
+    boost::system::error_code unimplementedProcess(const XMLNode &node);
 
     // These are all the system commands
-    retcode_t commandProcess(const XMLNode &node);
+    boost::system::error_code commandProcess(const XMLNode &node);
 
     // These format client side messages to the daemon
     std::string &statusCreate(meter_data_t *data);
@@ -178,11 +178,11 @@ public:
 
     void methodSet(const std::string &, methodPtr_t func);
     methodPtr_t methodGet(const std::string &name);
-    retcode_t methodProcess(const std::string &name, XMLNode &);
+    boost::system::error_code methodProcess(const std::string &name, XMLNode 
&);
     void methodsDump(void);
 
     std::string cacheGet(const std::string &);
-    retcode_t cacheAdd(const std::string &name, const std::string &);
+    boost::system::error_code cacheAdd(const std::string &name, const 
std::string &);
     void cacheDump(void);
     
     std::string &thisIPGet(void) { return _thisip; };
@@ -190,7 +190,7 @@ public:
     std::string &thisHostnameGet(void) { return _remoteip; };
     std::string &remoteHostnameGet(void) { return _remotehost; };
 
-    retcode_t findTag(const std::string &);
+    boost::system::error_code findTag(const std::string &);
   
 private:
     float               _version;
diff --git a/lib/rc.cc b/lib/rc.cc
index 1264b4a..0e7686a 100644
--- a/lib/rc.cc
+++ b/lib/rc.cc
@@ -27,13 +27,14 @@
 #include <cstring>
 #include <iostream>
 #include <fstream>
+#include <boost/system/error_code.hpp>
 
-#include "err.h"
 #include "log.h"
 #include "rc.h"
 
-using namespace rcinit;
-  
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
+
 RCinitFile::RCinitFile()
 {
 }
@@ -43,7 +44,7 @@ RCinitFile::~RCinitFile()
 }
 
 // Look for a config file in the likely places.
-retcode_t
+boost::system::error_code
 RCinitFile::load_files()
 {
     char *home;
@@ -65,11 +66,11 @@ RCinitFile::load_files()
         return parse_file(loadfile);
     }
   
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
 
 // Parse the config file and set the variables.
-retcode_t
+boost::system::error_code
 RCinitFile::parse_file(std::string &filespec)
 {
     struct stat stats;
@@ -80,7 +81,7 @@ RCinitFile::parse_file(std::string &filespec)
 
     BOOST_LOG(lg) << "Seeing if " << filespec << " exists.";
     if (filespec.size() == 0) {
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
   
     if (stat(filespec.c_str(), &stats) == 0) {
@@ -88,7 +89,7 @@ RCinitFile::parse_file(std::string &filespec)
     
         if (!in) {
             BOOST_LOG(lg) << "ERROR: Couldn't open file: " << filespec;
-            return ERROR;
+            errc::make_error_code(errc::not_supported);
         }
 
         // Read in each line and parse it
@@ -135,21 +136,21 @@ RCinitFile::parse_file(std::string &filespec)
         if (in) {
             in.close();
         }
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }  
 
     if (in) {
         in.close();
     }
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
 // Write the changed settings to the config file
-retcode_t
+boost::system::error_code
 RCinitFile::update_file(std::string &filespec)
 {
     std::cerr << __PRETTY_FUNCTION__ << "ERROR: unimplemented!" << std::endl;
-    return ERROR;
+    errc::make_error_code(errc::not_supported);
 }
 
 // local Variables:
diff --git a/lib/rc.h b/lib/rc.h
index 1955ccb..fa674bb 100644
--- a/lib/rc.h
+++ b/lib/rc.h
@@ -25,18 +25,16 @@
 #endif
 
 #include <cstring>
-#include "err.h"
+#include <boost/system/error_code.hpp>
 
-namespace rcinit {
-  
 class RCinitFile 
 {
 public:
     RCinitFile();
     ~RCinitFile();
-    retcode_t load_files();
-    retcode_t parse_file(std::string &filespec);
-    retcode_t update_file(std::string &filespec);
+    boost::system::error_code load_files();
+    boost::system::error_code parse_file(std::string &filespec);
+    boost::system::error_code update_file(std::string &filespec);
 
     // Database config options
     std::string dbhostGet()   { return _dbhost; }
@@ -56,9 +54,6 @@ private:
     std::string _device;
 }; 
 
-// End of rcinit namespace 
-}
-
 // __RC_H__
 #endif
 
diff --git a/lib/sharedlib.cc b/lib/sharedlib.cc
index 537ee33..8bdb8df 100644
--- a/lib/sharedlib.cc
+++ b/lib/sharedlib.cc
@@ -27,21 +27,23 @@
 #include "sharedlib.h"
 
 using namespace std;
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
 
 extern LogFile dbglogfile;
 
-retcode_t
+boost::system::error_code
 SharedLib::CloseLib (ErrCond &err)
 {
     lt_dlclose (dlhandle);
 }
 
-retcode_t
+boost::system::error_code
 SharedLib::OpenLib (string &filespec, ErrCond &Err)
 {
     DEBUGLOG_REPORT_FUNCTION;
 
-    retcode_t (*FuncAddr)(void);
+    boost::system::error_code (*FuncAddr)(void);
     int errors = 0;
     char *errmsg;
     char pwd[512];
@@ -54,7 +56,7 @@ SharedLib::OpenLib (string &filespec, ErrCond &Err)
           case ENOENT:
               Err.SetMsg("Specified shared library doesn't exist");
               BOOST_LOG(lg) << "ERROR: Dynamic library, " << filespec << " 
doesn't exist!" << endl;
-              return ERROR;
+              errc::make_error_code(errc::not_supported);
               break;
         }
     }
@@ -75,7 +77,7 @@ SharedLib::OpenLib (string &filespec, ErrCond &Err)
 
     if (errors) {
         Err << "Couldn't initialize ltdl";
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
 
     BOOST_LOG(lg) << "Initialized ltdl" << endl;
@@ -92,7 +94,7 @@ SharedLib::OpenLib (string &filespec, ErrCond &Err)
     errors = lt_dladdsearchdir (abelmon);
     if (errors) {
         Err << lt_dlerror();
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
 
     BOOST_LOG(lg) << "Added " << abelmon << " to the search paths" << endl;
@@ -103,13 +105,13 @@ SharedLib::OpenLib (string &filespec, ErrCond &Err)
 
     if (dlhandle == NULL) {
         Err << lt_dlerror();
-        return ERROR;
+        errc::make_error_code(errc::not_supported);
     }
 
     dlname = filespec;
   
     BOOST_LOG(lg) << "Opened dynamic library " << filespec << endl;
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
 entrypoint *
@@ -134,7 +136,7 @@ SharedLib::GetSymbol (std::string &symbol, ErrCond &err)
 
 #if 0
 // Open the database
-retcode_t
+boost::system::error_code
 SharedLib::ScanDir (void) {
     DEBUGLOG_REPORT_FUNCTION;
   
@@ -142,7 +144,7 @@ SharedLib::ScanDir (void) {
     struct device_info *info;
     struct dirent *entry;
     lt_dlhandle dlhandle;
-    retcode_t (*InitDBaddr)(void);
+    boost::system::error_code (*InitDBaddr)(void);
     lt_ptr_t addr;
     struct errcond err;
 
@@ -173,7 +175,7 @@ SharedLib::ScanDir (void) {
         // we get all the duplicates.
         entry = readdir(library_dir);
         if ((int)entry < 1)
-            return SUCCESS;
+            errc::make_error_code(errc::success);
 
         //    handle = dlopen (entry->d_name, RTLD_NOW|RTLD_GLOBAL);
         dlhandle = lt_dlopen (entry->d_name);
@@ -181,7 +183,7 @@ SharedLib::ScanDir (void) {
             continue;
         }
         cout << "Opening " << entry->d_name << endl;
-        //    InitDBaddr = (retcode_t (*)(...))dlsym (handle, "InitDB");
+        //    InitDBaddr = (boost::system::error_code (*)(...))dlsym (handle, 
"InitDB");
         (lt_ptr_t) InitDBaddr = lt_dlsym (dlhandle, "InitDB");
         if (InitDBaddr != NULL) {
             //      BOOST_LOG(lg) << "Found OpenDB in " << entry->d_name << 
endl;
diff --git a/lib/sharedlib.h b/lib/sharedlib.h
index 5a32298..2adf95c 100644
--- a/lib/sharedlib.h
+++ b/lib/sharedlib.h
@@ -23,17 +23,19 @@
 #include <ltdl.h>
 
 #include "log.h"
-#include "err.h"
 
-typedef retcode_t entrypoint (unsigned char *buf, int bytes, struct errcond 
*err);
+#include <boost/system/error_code.hpp>
+using namespace boost::system;
 
-typedef retcode_t IOentrypoint (FILE *, struct errcond *err);
+typedef boost::system::error_code entrypoint (unsigned char *buf, int bytes, 
struct errcond *err);
+
+typedef boost::system::error_code IOentrypoint (FILE *, struct errcond *err);
 
 class SharedLib
 {
 public:
-    retcode_t OpenLib (std::string &name, ErrCond &Err);
-    retcode_t CloseLib (ErrCond &Err);
+    boost::system::error_code OpenLib (std::string &name, ErrCond &Err);
+    boost::system::error_code CloseLib (ErrCond &Err);
     entrypoint *GetSymbol (std::string &name, ErrCond &Err);
 
     // Accessors for the protocol name
diff --git a/lib/snmp.cc b/lib/snmp.cc
index c83464b..a69c676 100644
--- a/lib/snmp.cc
+++ b/lib/snmp.cc
@@ -28,10 +28,14 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <iostream>
+#include <boost/system/error_code.hpp>
+#include <boost/log/core.hpp>
 
-#include "err.h"
 #include "snmp.h"
 #include "proc.h"
+#include "log.h"
+
+using namespace boost::system;
 
 #if 0
 #include "ifTable.h"
@@ -49,8 +53,6 @@ extern "C" {
 #define NETSNMP_ATTRIBUTE_DEPRECATED 1
 #endif
 
-using namespace std;
-
 SnmpClient::SnmpClient()
 {
 }
@@ -59,7 +61,7 @@ SnmpClient::~SnmpClient()
 {
 }
 
-retcode_t
+boost::system::error_code
 SnmpClient::open(std::string init, std::string mibname)
 {
     // PowerGuru
@@ -78,15 +80,16 @@ SnmpClient::open(std::string init, std::string mibname)
     
     _pdu = snmp_pdu_create(SNMP_MSG_GET);
     
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
-retcode_t
+boost::system::error_code
 SnmpClient::close(void)
 {
     snmp_close(_handle);
-    cerr << __PRETTY_FUNCTION__ << "ERROR: unimplemented!" << endl;
-    return ERROR;
+    BOOST_LOG_SEV(lg, severity_level::warning) << __PRETTY_FUNCTION__
+                                               << "ERROR: unimplemented!";
+    errc::make_error_code(errc::not_supported);
 }
 
 struct snmp_pdu *
@@ -131,7 +134,7 @@ SnmpDaemon::~SnmpDaemon()
 }
 
 
-retcode_t
+boost::system::error_code
 SnmpDaemon::master(bool background)
 {
     // print log errors to syslog or stderr
@@ -193,11 +196,11 @@ SnmpDaemon::master(bool background)
     snmp_shutdown("powerguru");
     SOCK_CLEANUP;
     
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 
 #if 0
-retcode_t
+boost::system::error_code
 SnmpDaemon::process(void)
 {
     int             numfds, count;
@@ -216,7 +219,7 @@ SnmpDaemon::process(void)
         snmp_read(&readfds);
     }
     
-    return SUCCESS;
+    errc::make_error_code(errc::success);
 }
 #endif
 
diff --git a/lib/snmp.h b/lib/snmp.h
index 98e4a65..4724d1a 100644
--- a/lib/snmp.h
+++ b/lib/snmp.h
@@ -32,10 +32,7 @@
 /* If you have sys/time.h on your machine: */
 #include <sys/time.h>
 
-/* Else pick one of these instead:
-#include <time.h>
-#include <sys/timeb.h>
-*/
+#include <boost/system/error_code.hpp>
 
 /* if on windows: */
 #ifdef WIN32
@@ -75,15 +72,14 @@
 #include <net-snmp/agent/scalar.h>
 
 #include <cstring>
-#include "err.h"
 
 class SnmpClient
 {
 public:
     SnmpClient();
     ~SnmpClient();
-    retcode_t open(std::string init, std::string mibname);
-    retcode_t close(void);
+    boost::system::error_code open(std::string init, std::string mibname);
+    boost::system::error_code close(void);
     struct snmp_pdu *read(std::string mibnode);
 private:
     std::string           *_hostname;
@@ -102,11 +98,11 @@ class SnmpDaemon
 public:
     SnmpDaemon();
     ~SnmpDaemon();
-    retcode_t master(bool background);
-    retcode_t start(std::string init, std::string mibname);
-    retcode_t close(void);
+    boost::system::error_code master(bool background);
+    boost::system::error_code start(std::string init, std::string mibname);
+    boost::system::error_code close(void);
     struct snmp_pdu *readSnmp(std::string mibnode);
-    retcode_t process(void);
+    boost::system::error_code process(void);
   
 private:
     std::string           *_hostname;
diff --git a/lib/tcpip.cc b/lib/tcpip.cc
index 17b11bc..3c23250 100644
--- a/lib/tcpip.cc
+++ b/lib/tcpip.cc
@@ -1,5 +1,6 @@
 // 
-// Copyright (C) 2005, 2006 - 2018
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+//               2014, 2015, 2016, 2017, 2018, 2019
 //      Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
@@ -21,6 +22,10 @@
 # include "config.h"
 #endif
 
+#include <array>
+#include <string>
+#include <iostream>
+
 #include <sys/types.h>
 #include <sys/time.h>
 #include <unistd.h>
@@ -95,7 +100,7 @@ retcode_t
 Tcpip::createNetServer(short port, const std::string &protocol)
 {
     DEBUGLOG_REPORT_FUNCTION;
-  
+
     struct protoent *ppe = 0;
     struct sockaddr_in sock_in;
     int             on, type;
@@ -141,7 +146,7 @@ Tcpip::createNetServer(short port, const std::string 
&protocol)
     }
     
     BOOST_LOG(lg) << "Listening for net traffic on fd #" << _sockIOfd;
-
+    
     return SUCCESS;
 }
 
@@ -335,7 +340,7 @@ Tcpip::createNetClient(const std::string &hostname, short 
port,
   
     // For a client, the IO file descriptor is the same as the default one
     _sockIOfd = _sockfd;
-
+    
     return SUCCESS;
 }
 
@@ -747,7 +752,7 @@ Tcpip::writeNet(const std::vector<unsigned char> &buffer)
 }
 
 Tcpip &
-Tcpip::operator = (Tcpip &tcp) 
+Tcpip::operator = (Tcpip &tcp)
 {
     _sockfd = _sockfd;
     _sockIOfd = _sockIOfd;
@@ -758,6 +763,77 @@ Tcpip::operator = (Tcpip &tcp)
     _port = _port;
 }
 
+////////////////////////////////////////////////
+
+using namespace boost::asio;
+using namespace boost::asio::ip;
+//io_service ioservice;
+// tcp::resolver resolv{ioservice};
+//tcp::socket tcp_socket{ioservice};
+//std::array<char, 4096> bytes;
+
+// For boost::asio
+static io_service       ioservice;
+static tcp::endpoint    tcp_endpoint{tcp::v4(), 2014};
+static tcp::acceptor    tcp_acceptor{ioservice, tcp_endpoint};
+static tcp::socket      tcp_socket{ioservice};
+static std::array<char, 4096> bytes;
+
+void
+read_handler(const boost::system::error_code &ec,
+             std::size_t bytes_transferred)
+{
+    DEBUGLOG_REPORT_FUNCTION;
+    if (!ec) {
+        std::cout.write(bytes.data(), bytes_transferred);
+        tcp_socket.async_read_some(buffer(bytes), read_handler);
+    }
+}
+
+void
+connect_handler(const boost::system::error_code &ec)
+{
+    DEBUGLOG_REPORT_FUNCTION;
+    if (!ec) {
+        std::string r =
+            "GET / HTTP/1.1\r\nHost: theboostcpplibraries.com\r\n\r\n";
+        write(tcp_socket, buffer(r));
+        tcp_socket.async_read_some(buffer(bytes), read_handler);
+    }
+}
+
+void
+write_handler(const boost::system::error_code &ec,
+  std::size_t bytes_transferred)
+{
+    DEBUGLOG_REPORT_FUNCTION;
+    if (!ec) {
+        tcp_socket.shutdown(tcp::socket::shutdown_send);
+    }
+}
+
+void
+accept_handler(const boost::system::error_code &ec)
+{
+    DEBUGLOG_REPORT_FUNCTION;
+    if (!ec) {
+        std::time_t now = std::time(nullptr);
+        static std::string data;
+        data = std::ctime(&now);
+        async_write(tcp_socket, buffer(data), write_handler);
+    }
+}
+
+void
+resolve_handler(const boost::system::error_code &ec,
+  tcp::resolver::iterator it)
+{
+    DEBUGLOG_REPORT_FUNCTION;
+    if (!ec) {
+        tcp_socket.async_connect(*it, connect_handler);
+    }
+}
+
 // local Variables:
 // mode: C++
 // indent-tabs-mode: nil
diff --git a/lib/tcpip.h b/lib/tcpip.h
index d67af8a..b7579c4 100644
--- a/lib/tcpip.h
+++ b/lib/tcpip.h
@@ -24,6 +24,11 @@
 # include "config.h"
 #endif
 
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/write.hpp>
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/ip/tcp.hpp>
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -40,8 +45,8 @@ extern const short DEFAULTPORT;
 class Tcpip : public Tcputil
 {
 public:
-    Tcpip(void);
-    ~Tcpip(void);
+    Tcpip(void) {};
+    ~Tcpip(void) {};
 
     // Create a new server. After creating it, then you have to wait for an
     // incoming connection.
@@ -132,6 +137,19 @@ protected:
     bool                _console;
 };
 
+/////////////////////////////////////////////
+using namespace boost::asio;
+using namespace boost::asio::ip;
+
+extern void read_handler(const boost::system::error_code &ec,
+                  std::size_t bytes_transferred);
+extern void connect_handler(const boost::system::error_code &ec);
+extern void resolve_handler(const boost::system::error_code &ec,
+                            boost::asio::ip::tcp::resolver::iterator it);
+extern void write_handler(const boost::system::error_code &ec,
+                   std::size_t bytes_transferred);
+void accept_handler(const boost::system::error_code &ec);
+    
 // EOF __TCPIP_H__ */
 #endif
 
diff --git a/lib/tcputil.h b/lib/tcputil.h
index dfc4a76..e2b1bdb 100644
--- a/lib/tcputil.h
+++ b/lib/tcputil.h
@@ -49,10 +49,10 @@ public:
         struct saddr;
     };
 
-    Tcputil();
+    Tcputil() {};
     Tcputil(const std::string &host);
     Tcputil(const std::string &host, short port);
-    ~Tcputil();
+    ~Tcputil() {};
     
     // This gets the servent data that contains the port
     // number as specified by it's /etc/services file entry.
diff --git a/lib/xml.cc b/lib/xml.cc
index d222b46..c1d8f7b 100644
--- a/lib/xml.cc
+++ b/lib/xml.cc
@@ -1,5 +1,6 @@
 // 
-// Copyright (C) 2005, 2006 - 2018
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+//               2014, 2015, 2016, 2017, 2018, 2019
 //      Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
@@ -52,17 +53,14 @@
 XMLNode *
 XML::extractNode(xmlNodePtr node)
 {
-    DEBUGLOG_REPORT_FUNCTION;
+//    DEBUGLOG_REPORT_FUNCTION;
     xmlAttrPtr attr;
     xmlNodePtr childnode;
     xmlChar *ptr = NULL;
     XMLNode *child;
     int len;
 
-    // BOOST_LOG(lg) << "\rCreated new element for " << (const char 
*)node->name << " at " << element << std::endl;
-
-    BOOST_LOG(lg) << "extracting node " << node->name << std::endl;
-
+    // BOOST_LOG_SEV(lg, severity_level::debug) << "extracting node " << 
node->name;
     XMLNode *xml = new XMLNode;
     std::string name;
     std::string value;
@@ -76,10 +74,10 @@ XML::extractNode(xmlNodePtr node)
             xml->attribAdd(name, value);
             attr = attr->next;
 #if 0
-            BOOST_LOG(lg) << "FIXME: attribute " << node->name
-                       << " has property "
-                       << name << " value is "
-                       << value << std::endl;
+            BOOST_LOG_SEV(lg, severity_level::debug)
+                << "FIXME: attribute " << node->name
+                << " has property " << name
+                << " value is " << value;
 #endif
         }
     }
@@ -100,9 +98,10 @@ XML::extractNode(xmlNodePtr node)
         if (ptr != NULL) {
             //value = reinterpret_cast<const char *>(node->children->content);
             value = reinterpret_cast<const char *>(ptr);
-#if 1
-            BOOST_LOG(lg) << "\tChild node: " << name
-                       << " has contents " << value << std::endl;
+#if 0
+            BOOST_LOG_SEV(lg, severity_level::debug)
+                << "\tChild node: " << name
+                << " has contents " << value;
 #endif
             xml->valueSet(value.substr(0, value.find('\n')));
             xmlFree(ptr);
@@ -114,14 +113,17 @@ XML::extractNode(xmlNodePtr node)
 
     while (childnode != NULL) {
         if (childnode->type == XML_ELEMENT_NODE) {
-            BOOST_LOG(lg) << "\tfound node " << (const char *)childnode->name 
<< std::endl;
+#if 0
+            BOOST_LOG_SEV(lg, severity_level::debug)
+                << "\tfound node " << (const char *)childnode->name;
+#endif
             XMLNode *child = extractNode(childnode);
             //if (child->_value.get_type() != as_value::UNDEFINED) {
-#if 1
-            BOOST_LOG(lg) << "\tPushing child Node " << child->nameGet()
-                       << " value " << child->valueGet()
-                       <<  " on element "
-                       <<  xml->nameGet() << std::endl;
+#if 0
+            BOOST_LOG_SEV(lg, severity_level::debug)
+                << "\tPushing child Node " << child->nameGet()
+                << " value " << child->valueGet()
+                <<  " on element " <<  xml->nameGet();
 #endif
             xml->childAdd(child);
         }
@@ -136,13 +138,14 @@ XML::extractNode(xmlNodePtr node)
 bool
 XML::parseMem(const std::string &xml_in)
 {
-    DEBUGLOG_REPORT_FUNCTION;
+    //DEBUGLOG_REPORT_FUNCTION;
     bool          ret = true;
 
-    BOOST_LOG(lg) << "Parse XML from memory: " << xml_in.c_str() << std::endl;
+    BOOST_LOG_SEV(lg, severity_level::debug)
+        << "Parse XML from memory: \n\t" << xml_in.c_str();
 
     if (xml_in.size() == 0) {
-        BOOST_LOG(lg) << "ERROR: XML data is empty!" << std::endl;
+        BOOST_LOG_SEV(lg, severity_level::error) << "XML data is empty!";
         return false;
     }
 
@@ -150,7 +153,7 @@ XML::parseMem(const std::string &xml_in)
   
     _doc = xmlParseMemory(xml_in.c_str(), xml_in.size());
     if (_doc == 0) {
-        BOOST_LOG(lg) << "ERROR: Can't parse XML data!" << std::endl;
+        BOOST_LOG_SEV(lg, severity_level::error) << "Can't parse XML data!";
         return false;
     }
     _nodes = extractNode(xmlDocGetRootElement(_doc));
@@ -192,14 +195,15 @@ bool
 XML::parseFile(const std::string &filespec)
 {
     DEBUGLOG_REPORT_FUNCTION;
-    BOOST_LOG(lg) << "Load disk XML file: " << filespec << std::endl;
+    BOOST_LOG_SEV(lg, severity_level::debug) << "Load disk XML file: " << 
filespec;
   
     //BOOST_LOG(lg) << %s: mem is %d\n", __FUNCTION__, mem);
 
     xmlInitParser();
     _doc = xmlParseFile(filespec.c_str());
     if (_doc == 0) {
-        BOOST_LOG(lg) << "ERROR: Can't load XML file: " << filespec << 
std::endl;
+        BOOST_LOG_SEV(lg, severity_level::error) << "ERROR: Can't load XML 
file: "
+                                                 << filespec;
         return false;
     }
     //_nodes = extractNode(xmlDocGetRootElement(_doc));
@@ -211,24 +215,6 @@ XML::parseFile(const std::string &filespec)
     return true;
 }
 
-// const XMLNode &
-// XML::operator [] (int x) {
-//     // DEBUGLOG_REPORT_FUNCTION;
-//     return _nodes->childGet(x);
-// }
-
-// bool
-// XML::hasChildren(void)
-// {
-//     return (_nodes->childrenSize() > 0)? true : false;
-// }
-
-// const std::string &
-// XML::nodeNameGet(void)
-// {
-//     return _nodes->nameGet();
-// }
-
 void
 XMLNode::operator = (XMLNode &node)
 {
diff --git a/lib/xml.h b/lib/xml.h
index 8ae2d97..7f04d61 100644
--- a/lib/xml.h
+++ b/lib/xml.h
@@ -1,5 +1,6 @@
 // 
-// Copyright (C) 2005, 2006 - 2018
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+//               2014, 2015, 2016, 2017, 2018, 2019
 //      Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify

http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=c547928aff16337757eba32fd32940873615d182


commit c547928aff16337757eba32fd32940873615d182
Author: Rob Savoye <address@hidden>
Date:   Sat Jan 12 18:02:56 2019 -0700

    Using Boost error codes now

diff --git a/lib/err.cc b/lib/err.cc
deleted file mode 100644
index 957f4cc..0000000
--- a/lib/err.cc
+++ /dev/null
@@ -1,159 +0,0 @@
-// 
-// Copyright (C) 2005, 2006 - 2018
-//      Free Software Foundation, Inc.
-// 
-// 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, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-// This is generated by autoconf
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#include <cstring>
-
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-
-#include "err.h"
-
-#if 0
-ErrCond::ErrCond(void) {
-    ecode = 0;
-    line = 0;
-}
-
-ErrCond::ErrCond(int x) {
-    ecode = x;
-}
-#endif
-
-ErrCond::~ErrCond(void) {
-}
-
-ErrCond::ErrCond(const std::string &filein, int linein,
-                 const std::string &funcin, int codein,
-                 const std::string &s) {
-    file = filein;
-    func = funcin;
-    line = linein;
-    ecode = codein;
-    emsg = s;
-}
-
-// methods
-void
-ErrCond::ClearErr(void) {
-    file.erase();
-    func.erase();
-    line = 0;
-    ecode = 0;
-    errno = 0;
-    emsg.erase(); 
-}
-
-ErrCond &
-ErrCond::SetMsg (const std::string &filein, int linein,
-                 const std::string &funcin, int codein,
-                 const std::stringstring &s) {
-    file = filein;
-    func = funcin;
-    line = linein;
-    ecode = codein;
-    emsg = s;
-    return *this;
-}
-
-void
-ErrCond::SetMsg (const std::string &s) {
-    emsg = s;
-}
-
-void
-ErrCond::SetMsg (int x, const char *s) {
-    ecode = x;
-    emsg = s;
-}
-
-// This grabs the endl operator. If we see this, then we are done
-// formatting the string. We currently don't do anything with this.
-ostream&
-ErrCond::operator << (ostream & (&)(ostream &)) {
-    //  ClearErr();
-    cerr << __PRETTY_FUNCTION__ << ": not implemented!" << endl;
-    // FIXME: This return value is tottaly bogus, and exists only to
-    // shut up GCC until this actually gets implemented.
-    return cout;
-}
-
-ErrCond& 
-ErrCond::operator << (const std::string &x)
-{
-    emsg += x;
-    return *this;
-}
-
-ErrCond& 
-ErrCond::operator << (void *x)
-{
-    char buf[10];
-    sprintf ((char *)&buf, "%p", x);
-    emsg += buf;
-    return *this;
-}
-
-ErrCond& 
-ErrCond::operator << (int x)
-{
-    char buf[10];
-    sprintf ((char *)&buf, "%d", x);
-    emsg += buf;
-    return *this;
-}
-
-const std::ostream& 
-operator << (const std::ostream &os, ErrCond& e) {
-    std::string msg;
-    
-    if (e.GetCode() > EMEDIUMTYPE) {
-        msg = "WARNING: ";
-    } else {
-        msg = "ERROR: ";
-    }
-  
-    if (e.GetFunc().size() > 0)
-        msg += e.GetFunc();
-
-    if (e.GetLine() > 0)
-        msg += e.GetFunc();
-  
-    if (e.GetMsg().size() > 0)
-        msg += e.GetMsg();
-
-    if (errno) {
-        msg += " (";
-        msg += strerror(errno);
-        msg += ") ";
-    }
-  
-    return os << msg;
-}
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: nil
-// End:
diff --git a/lib/err.h b/lib/err.h
deleted file mode 100644
index a6a9b24..0000000
--- a/lib/err.h
+++ /dev/null
@@ -1,181 +0,0 @@
-// 
-// Copyright (C) 2005, 2006 - 2018.
-//      Free Software Foundation, Inc.
-// 
-// 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, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-#ifndef __ERR_H__
-#define __ERR_H__
-
-// This is the config file as produced by autoconf
-#include "config.h"
-        
-//#include <stdio.h>
-#include <errno.h>
-#include <cstring>
-
-// having to malloc() any memory. And this is it's size.
-#define ERRMSGSIZE 78
-        
-// Since NULL may have various values depending on the system,
-// we define our own string terminator.
-#define STRTERM '\0'
-
-// This is a set of common error codes used by Abelmon
-#define MEM_ERR         3               // memory read/write error
-#define IO_ERR          5               // I/O error
-#define TIMEOUT_ERR     6               // timeout
-#define UNIMP_ERR       7               // unimplemented
-#define NOSUPP_ERR      8               // unsupported
-#define NOSTOP_ERR      11              // wouldn't stop
-#define BADINT_ERR      12              // bad interface
-#define NO_DATA         13          // there is no data present
-
-// This hold all the data for an error condition
-// We use a statically allocate string so the C API can be used wihout
-// having to malloc() any memory. Too bad C doesn't support constructors.
-struct errcond {
-    int line;
-    char *func;
-    char *file;
-    char msg[ERRMSGSIZE+1];
-    int code;
-};
-
-// This is the data returned by all intelligent functions. It's similar
-// to the retcode produced by ILU, but we wanted ours to be different,
-// so we can add more to this as time goes on.
-typedef enum retcode {
-    ERROR,
-    SUCCESS
-} retcode_t;
-
-// Clear the error code and message
-static inline void CLEARERR (struct errcond *x) {
-    x->code=0;
-    x->msg[0] = STRTERM;
-};
-
-// Set an error message based on just an error message
-static inline void SETERRMSG (struct errcond *x, const char *y) {
-    x->code=-1;
-    strncpy (x->msg, y, ERRMSGSIZE);
-    x->msg[ERRMSGSIZE] = STRTERM;
-};
-
-// Get the error message
-static inline char *GETERRMSG (struct errcond *x) {
-    return x->msg;
-};
-
-// Set an error message based on an error code
-static inline void SETERRCODE (struct errcond *x, int y) {
-    x->code=y;
-    x->msg[0] = STRTERM;
-};
-
-// Get the error code
-static inline int GETERRCODE (struct errcond *x) {
-    return x->code;
-};
-
-// Get the error code
-static inline int ERRCOND (struct errcond *x) {
-    return ((x->code > 0 || x->msg[0] > 'a') ? x->code : 0);
-};
-
-// Set an error message based on the message and an error code
-static inline void SETERR(struct errcond *x, const char *y, int z) {
-    x->code=z;
-    if (y!=NULL) {
-        strncpy (x->msg, y, ERRMSGSIZE);
-        x->msg[ERRMSGSIZE] = STRTERM;
-    }
-};
-
-#ifdef __cplusplus
-#include <cstring>
-#include <iostream>
-
-#define WARNMSG (sys_nerr+1)
-
-#define SETERRCOND(err, txt) err.SetMsg(__FILE__, __LINE__, 
__PRETTY_FUNCTION__, errno, txt)
-#define SETWARNCOND(err, txt) err.SetMsg(__FILE__, __LINE__, 
__PRETTY_FUNCTION__, WARNMSG, txt)
-
-// Do this in C++ instead
-class ErrCond {
-public:
-    ErrCond(void) {
-        ecode = 0;
-        line = 0;
-    }
-    ErrCond(int x) {
-        ecode = x;
-    }
-
-    ~ErrCond(void);
-    ErrCond(const std::string &filein, int linein,
-            const std::string &funcin, int codein, const std::string &s);
-    // methods
-    void ClearErr(void);
-  
-    ErrCond &SetMsg (const std::string &filein, int linein, const std::string 
&funcin,
-                     int codein, const std::string &s);
-
-    void SetMsg (const std::string &s);
-    void SetCode(int x) { 
-        ecode = x;
-    }
-    int GetCode(void) { 
-        return ecode;
-    }
-    int GetLine(void) { 
-        return line;
-    }
-    const std::string &GetFile(void) { 
-        return file;
-    }
-  
-    const std::string &GetFunc(void) { 
-        return func;
-    }
-  
-    const std::string &GetMsg(void) { 
-        return emsg;
-    }
-
-    ErrCond &operator << (ErrCond &);
-    ErrCond &operator << (int x);
-    ErrCond &operator << (char const *str);
-    ErrCond &operator << (std::string &str);
-    ErrCond &operator << (void *addr);
-
-    friend std::ostream & operator << (std::ostream &os, ErrCond& e);
-    const std::ostream& operator << (std::ostream & (&)(std::ostream &));
-private:
-    std::string file;
-    std::string func;
-    int line;
-    int ecode;
-    std::string emsg;
-};
-
-#endif
-#endif         // __ERR_H__
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: nil
-// End:

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                        |  16 +-
 client/cmd.cc                      |  11 +-
 client/threads.cc                  |   7 +-
 configure.ac                       |  20 ++-
 daemon/main.cc                     |  30 ++--
 daemon/threads.cc                  |  23 ++-
 debian/compat                      |   1 +
 debian/powerguru.install           |   2 +
 debian/pypowerguru.install         |   2 +
 devices/serial.cc                  |  47 +++---
 devices/serial.h                   |  26 ++--
 lib/Makefile.am                    |  11 +-
 lib/commands.cc                    |  63 +++++---
 lib/commands.h                     |   2 +-
 lib/console.h                      |   4 +-
 lib/database.h                     |   2 +
 lib/err.cc                         | 159 -------------------
 lib/err.h                          | 181 ----------------------
 lib/msgs.cc                        | 193 ++++++++++++-----------
 lib/msgs.h                         |  69 +++++----
 lib/rc.cc                          |  27 ++--
 lib/rc.h                           |  13 +-
 lib/sharedlib.cc                   |  26 ++--
 lib/sharedlib.h                    |  12 +-
 lib/snmp.cc                        |  27 ++--
 lib/snmp.h                         |  18 +--
 lib/tcpip.cc                       |  86 ++++++++++-
 lib/tcpip.h                        |  22 ++-
 lib/tcputil.h                      |   4 +-
 lib/xml.cc                         |  72 ++++-----
 lib/xml.h                          |   3 +-
 {testsuite => python}/Makefile.am  |  29 ++--
 testsuite/libtests/tcpip-test.cc   | 304 -------------------------------------
 testsuite/libtests/tcputil-test.cc | 186 -----------------------
 34 files changed, 499 insertions(+), 1199 deletions(-)
 create mode 100644 debian/compat
 create mode 100644 debian/powerguru.install
 create mode 100644 debian/pypowerguru.install
 delete mode 100644 lib/err.cc
 delete mode 100644 lib/err.h
 copy {testsuite => python}/Makefile.am (59%)
 delete mode 100644 testsuite/libtests/tcpip-test.cc
 delete mode 100644 testsuite/libtests/tcputil-test.cc


hooks/post-receive
-- 
powerguru



reply via email to

[Prev in Thread] Current Thread [Next in Thread]