summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-02-28 19:09:43 +0100
committerMatthias Schiffer <matthias@gamezock.de>2009-02-28 19:09:43 +0100
commit46c110f7a14e4b5d0e8bd27259f7744ae8a36382 (patch)
tree94693ecffb8f1c553c12ea3a30920b2008e27b11 /src
parent8f85624a76934b14e0ba0f49413f471f8f4aa4f1 (diff)
downloadmad-46c110f7a14e4b5d0e8bd27259f7744ae8a36382.tar
mad-46c110f7a14e4b5d0e8bd27259f7744ae8a36382.zip
DaemonListRequest und DaemonStateUpdateRequest benutzen jetzt XML
Diffstat (limited to 'src')
-rw-r--r--src/Client/CommandManager.cpp1
-rw-r--r--src/Client/CommandParser.cpp1
-rw-r--r--src/Client/InformationManager.cpp47
-rw-r--r--src/Client/InformationManager.h10
-rw-r--r--src/Client/Requests/DaemonListRequest.cpp11
-rw-r--r--src/Client/Requests/DaemonListRequest.h9
-rw-r--r--src/Core/Backends/Makefile.am4
-rw-r--r--src/Core/Backends/Makefile.in406
-rw-r--r--src/Core/ConnectionManager.cpp6
-rw-r--r--src/Core/RequestHandlers/DaemonListRequestHandler.cpp30
-rw-r--r--src/Core/RequestHandlers/DaemonListRequestHandler.h6
-rw-r--r--src/Core/Requests/DaemonStateUpdateRequest.cpp14
-rw-r--r--src/Core/Requests/DaemonStateUpdateRequest.h8
-rw-r--r--src/Net/Packets/HostListPacket.cpp83
-rw-r--r--src/Net/Packets/HostListPacket.h80
-rw-r--r--src/Net/Packets/HostStatePacket.cpp50
-rw-r--r--src/Net/Packets/HostStatePacket.h74
-rw-r--r--src/Net/Packets/Makefile.am4
-rw-r--r--src/Net/Packets/Makefile.in9
19 files changed, 93 insertions, 760 deletions
diff --git a/src/Client/CommandManager.cpp b/src/Client/CommandManager.cpp
index 90d15ae..d98b041 100644
--- a/src/Client/CommandManager.cpp
+++ b/src/Client/CommandManager.cpp
@@ -22,7 +22,6 @@
#include <Common/Logger.h>
#include <Common/XmlRequest.h>
#include <Net/Packets/FSInfoPacket.h>
-#include <Net/Packets/HostListPacket.h>
#include <cmath>
#include <iostream>
diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp
index ff93aec..878e413 100644
--- a/src/Client/CommandParser.cpp
+++ b/src/Client/CommandParser.cpp
@@ -30,7 +30,6 @@
#include <Common/Requests/StatusRequest.h>
#include <Common/Requests/UserListRequest.h>
#include <Common/Tokenizer.h>
-#include <Net/Packets/HostListPacket.h>
#include <iostream>
#include <cstdio>
diff --git a/src/Client/InformationManager.cpp b/src/Client/InformationManager.cpp
index cef0ce1..616e09b 100644
--- a/src/Client/InformationManager.cpp
+++ b/src/Client/InformationManager.cpp
@@ -21,8 +21,6 @@
#include "Requests/DaemonListRequest.h"
#include <Common/Logger.h>
#include <Common/RequestManager.h>
-#include <Net/Packets/ErrorPacket.h>
-#include <Net/Packets/HostStatePacket.h>
namespace Mad {
@@ -31,10 +29,15 @@ namespace Client {
InformationManager InformationManager::informationManager;
-void InformationManager::DaemonStateUpdateRequest::handlePacket(Net::Connection *connection, const Net::Packet &packet) {
- if(packet.getType() != Net::Packet::DAEMON_STATE_UPDATE) {
+void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(Net::Connection *connection, uint16_t requestId, const Common::XmlPacket &packet) {
+ if(packet.getType() != "UpdateHostState") {
Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet.");
- connection->send(Net::Packets::ErrorPacket(Net::Packet::ERROR, packet.getRequestId(), Common::Exception(Common::Exception::UNEXPECTED_PACKET)));
+
+ Common::XmlPacket ret;
+ ret.setType("Error");
+ ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+
+ connection->send(ret.encode(requestId));
signalFinished().emit();
return;
@@ -42,26 +45,26 @@ void InformationManager::DaemonStateUpdateRequest::handlePacket(Net::Connection
// TODO Require authentication
- Net::Packets::HostStatePacket hostStatePacket(packet);
-
- std::map<std::string, Common::HostInfo>::iterator host = informationManager.get()->daemons.find(hostStatePacket.getName());
+ std::map<std::string, Common::HostInfo>::iterator host = informationManager.get()->daemons.find(packet["name"]);
if(host != informationManager.get()->daemons.end())
- host->second.setState(hostStatePacket.getState());
+ host->second.setState(packet["state"]);
else
Common::Logger::log(Common::Logger::WARNING, "Received a state update for an unknown host.");
- connection->send(Net::Packet(Net::Packet::OK, packet.getRequestId()));
+ Common::XmlPacket ret;
+ ret.setType("OK");
+ connection->send(ret.encode(requestId));
signalFinished().emit();
}
void InformationManager::doInit() {
- Common::RequestManager::get()->registerPacketType<DaemonStateUpdateRequest>(Net::Packet::DAEMON_STATE_UPDATE);
+ Common::RequestManager::get()->registerPacketType<DaemonStateUpdateRequestHandler>("UpdateHostState");
}
void InformationManager::doDeinit() {
- Common::RequestManager::get()->unregisterPacketType(Net::Packet::DAEMON_STATE_UPDATE);
+ Common::RequestManager::get()->unregisterPacketType("UpdateHostState");
}
void InformationManager::updateDaemonList(Net::Connection *con) {
@@ -69,7 +72,7 @@ void InformationManager::updateDaemonList(Net::Connection *con) {
return;
Common::RequestManager::get()->sendRequest(con,
- std::auto_ptr<Common::RequestBase>(
+ std::auto_ptr<Common::XmlRequest>(
new Requests::DaemonListRequest(sigc::mem_fun(this, &InformationManager::daemonListRequestFinished))
)
);
@@ -77,13 +80,21 @@ void InformationManager::updateDaemonList(Net::Connection *con) {
updating = true;
}
-void InformationManager::daemonListRequestFinished(const Common::Request<Net::Packets::HostListPacket> &request) {
+void InformationManager::daemonListRequestFinished(const Common::XmlRequest &request) {
try {
- const std::vector<Common::HostInfo> &hostInfo = request.getResult().getHostInfo();
+ const Common::XmlPacket &packet = request.getResult();
+
+ const Common::XmlPacket::Element &hostInfo = packet["hosts"];
+
+ daemons.clear();
+
+ for(size_t i = 0; i < hostInfo.getSize(); ++i) {
+ Common::HostInfo info;
+ info.setName(hostInfo[i]["name"]);
+ info.setIP(hostInfo[i]["address"]);
+ info.setState(hostInfo[i]["state"]);
- for(std::vector<Common::HostInfo>::const_iterator daemon = hostInfo.begin(); daemon != hostInfo.end(); ++daemon) {
- daemons.clear();
- daemons.insert(std::make_pair(daemon->getName(), *daemon));
+ daemons.insert(std::make_pair(info.getName(), info));
}
}
catch(Common::Exception &e) {
diff --git a/src/Client/InformationManager.h b/src/Client/InformationManager.h
index 80dab9f..890622c 100644
--- a/src/Client/InformationManager.h
+++ b/src/Client/InformationManager.h
@@ -25,7 +25,7 @@
#include <Common/HostInfo.h>
#include <Common/Initializable.h>
-#include <Common/Request.h>
+#include <Common/XmlRequest.h>
namespace Mad {
@@ -42,12 +42,12 @@ namespace Client {
class InformationManager : public Common::Initializable {
private:
- class DaemonStateUpdateRequest : public Common::RequestHandler {
+ class DaemonStateUpdateRequestHandler : public Common::XmlRequestHandler {
protected:
- virtual void handlePacket(Net::Connection *connection, const Net::Packet &packet);
+ virtual void handlePacket(Net::Connection *connection, uint16_t requestId, const Common::XmlPacket &packet);
public:
- DaemonStateUpdateRequest() {}
+ DaemonStateUpdateRequestHandler() {}
};
static InformationManager informationManager;
@@ -62,7 +62,7 @@ class InformationManager : public Common::Initializable {
InformationManager() : updating(false) {}
- void daemonListRequestFinished(const Common::Request<Net::Packets::HostListPacket> &request);
+ void daemonListRequestFinished(const Common::XmlRequest &request);
protected:
virtual void doInit();
diff --git a/src/Client/Requests/DaemonListRequest.cpp b/src/Client/Requests/DaemonListRequest.cpp
index 690aaea..ec80828 100644
--- a/src/Client/Requests/DaemonListRequest.cpp
+++ b/src/Client/Requests/DaemonListRequest.cpp
@@ -25,16 +25,19 @@ namespace Client {
namespace Requests {
void DaemonListRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
- connection->send(Net::Packet(Net::Packet::LIST_DAEMONS, requestId));
+ Common::XmlPacket packet;
+
+ packet.setType("ListHosts");
+ connection->send(packet.encode(requestId));
}
-void DaemonListRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
- if(packet.getType() != Net::Packet::OK) {
+void DaemonListRequest::handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet) {
+ if(packet.getType() != "OK") {
finishWithError(Common::Exception(Common::Exception::UNEXPECTED_PACKET));
return; // TODO Logging
}
- finish(Net::Packets::HostListPacket(packet));
+ finish(packet);
}
}
diff --git a/src/Client/Requests/DaemonListRequest.h b/src/Client/Requests/DaemonListRequest.h
index fbf0e70..ca37dbd 100644
--- a/src/Client/Requests/DaemonListRequest.h
+++ b/src/Client/Requests/DaemonListRequest.h
@@ -20,20 +20,19 @@
#ifndef MAD_CLIENT_REQUEST_DAEMONLISTREQUEST_H_
#define MAD_CLIENT_REQUEST_DAEMONLISTREQUEST_H_
-#include <Common/Request.h>
-#include <Net/Packets/HostListPacket.h>
+#include <Common/XmlRequest.h>
namespace Mad {
namespace Client {
namespace Requests {
-class DaemonListRequest : public Common::Request<Net::Packets::HostListPacket> {
+class DaemonListRequest : public Common::XmlRequest {
protected:
virtual void sendRequest(Net::Connection *connection, uint16_t requestId);
- virtual void handlePacket(Net::Connection *connection, const Net::Packet &packet);
+ virtual void handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet);
public:
- DaemonListRequest(slot_type slot) : Common::Request<Net::Packets::HostListPacket>(slot) {}
+ DaemonListRequest(slot_type slot) : Common::XmlRequest(slot) {}
};
}
diff --git a/src/Core/Backends/Makefile.am b/src/Core/Backends/Makefile.am
deleted file mode 100644
index 3f08197..0000000
--- a/src/Core/Backends/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-noinst_LTLIBRARIES = libbackends.la
-libbackends_la_SOURCES =
-
-noinst_HEADERS =
diff --git a/src/Core/Backends/Makefile.in b/src/Core/Backends/Makefile.in
deleted file mode 100644
index d905185..0000000
--- a/src/Core/Backends/Makefile.in
+++ /dev/null
@@ -1,406 +0,0 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/Core/Backends
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \
- $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libbackends_la_LIBADD =
-am_libbackends_la_OBJECTS =
-libbackends_la_OBJECTS = $(am_libbackends_la_OBJECTS)
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-SOURCES = $(libbackends_la_SOURCES)
-DIST_SOURCES = $(libbackends_la_SOURCES)
-HEADERS = $(noinst_HEADERS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-ARGZ_H = @ARGZ_H@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-GSSAPI_LIBS = @GSSAPI_LIBS@
-GnuTLS_CFLAGS = @GnuTLS_CFLAGS@
-GnuTLS_LIBS = @GnuTLS_LIBS@
-INCLTDL = @INCLTDL@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBADD_DL = @LIBADD_DL@
-LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
-LIBADD_DLOPEN = @LIBADD_DLOPEN@
-LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
-LIBLTDL = @LIBLTDL@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTDLDEPS = @LTDLDEPS@
-LTDLINCL = @LTDLINCL@
-LTDLOPEN = @LTDLOPEN@
-LTLIBOBJS = @LTLIBOBJS@
-LT_CONFIG_H = @LT_CONFIG_H@
-LT_DLLOADERS = @LT_DLLOADERS@
-LT_DLPREOPEN = @LT_DLPREOPEN@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-MYSQL_CFLAGS = @MYSQL_CFLAGS@
-MYSQL_CONFIG = @MYSQL_CONFIG@
-MYSQL_LDFLAGS = @MYSQL_LDFLAGS@
-MYSQL_VERSION = @MYSQL_VERSION@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-RANLIB = @RANLIB@
-READLINE_LIBS = @READLINE_LIBS@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-have_df = @have_df@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libxml2_CFLAGS = @libxml2_CFLAGS@
-libxml2_LIBS = @libxml2_LIBS@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-ltdl_LIBOBJS = @ltdl_LIBOBJS@
-ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sigc_CFLAGS = @sigc_CFLAGS@
-sigc_LIBS = @sigc_LIBS@
-srcdir = @srcdir@
-sys_symbol_underscore = @sys_symbol_underscore@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-noinst_LTLIBRARIES = libbackends.la
-libbackends_la_SOURCES =
-noinst_HEADERS =
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Core/Backends/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Core/Backends/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-libbackends.la: $(libbackends_la_OBJECTS) $(libbackends_la_DEPENDENCIES)
- $(LINK) $(libbackends_la_OBJECTS) $(libbackends_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-info: install-info-am
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-ps: install-ps-am
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- clean-noinstLTLIBRARIES distclean distclean-compile \
- distclean-generic distclean-libtool distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- uninstall uninstall-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp
index f46939d..607f80b 100644
--- a/src/Core/ConnectionManager.cpp
+++ b/src/Core/ConnectionManager.cpp
@@ -50,7 +50,7 @@ void ConnectionManager::updateState(const std::string &name, Common::HostInfo::S
daemonInfo[name].setState(state);
for(std::list<Net::ServerConnection*>::iterator con = clientConnections.begin(); con != clientConnections.end(); ++con) {
- Common::RequestManager::get()->sendRequest(*con, std::auto_ptr<Common::RequestBase>(
+ Common::RequestManager::get()->sendRequest(*con, std::auto_ptr<Common::XmlRequest>(
new Requests::DaemonStateUpdateRequest(name, state)
));
}
@@ -139,12 +139,12 @@ void ConnectionManager::doInit() {
Common::RequestManager::get()->registerPacketType<RequestHandlers::DaemonCommandRequestHandler>(Net::Packet::DAEMON_COMMAND_REBOOT);
Common::RequestManager::get()->registerPacketType<RequestHandlers::DaemonCommandRequestHandler>(Net::Packet::DAEMON_COMMAND_SHUTDOWN);
Common::RequestManager::get()->registerPacketType<RequestHandlers::DaemonFSInfoRequestHandler>(Net::Packet::DAEMON_FS_INFO);
- Common::RequestManager::get()->registerPacketType<RequestHandlers::DaemonListRequestHandler>(Net::Packet::LIST_DAEMONS);
Common::RequestManager::get()->registerPacketType<RequestHandlers::GSSAPIAuthRequestHandler>(Net::Packet::GSSAPI_AUTH);
Common::RequestManager::get()->registerPacketType<RequestHandlers::IdentifyRequestHandler>(Net::Packet::IDENTIFY);
Common::RequestManager::get()->registerPacketType<Common::RequestHandlers::StatusRequestHandler>("GetStatus");
Common::RequestManager::get()->registerPacketType<RequestHandlers::DaemonStatusRequestHandler>("GetDaemonStatus");
+ Common::RequestManager::get()->registerPacketType<RequestHandlers::DaemonListRequestHandler>("ListHosts");
Common::RequestManager::get()->registerPacketType<RequestHandlers::UserListRequestHandler>("ListUsers");
Common::RequestManager::get()->registerPacketType<RequestHandlers::LogRequestHandler>("Log");
}
@@ -160,12 +160,12 @@ void ConnectionManager::doDeinit() {
Common::RequestManager::get()->unregisterPacketType(Net::Packet::DAEMON_COMMAND_REBOOT);
Common::RequestManager::get()->unregisterPacketType(Net::Packet::DAEMON_COMMAND_SHUTDOWN);
Common::RequestManager::get()->unregisterPacketType(Net::Packet::DAEMON_FS_INFO);
- Common::RequestManager::get()->unregisterPacketType(Net::Packet::LIST_DAEMONS);
Common::RequestManager::get()->unregisterPacketType(Net::Packet::GSSAPI_AUTH);
Common::RequestManager::get()->unregisterPacketType(Net::Packet::IDENTIFY);
Common::RequestManager::get()->unregisterPacketType("GetStatus");
Common::RequestManager::get()->unregisterPacketType("GetDaemonStatus");
+ Common::RequestManager::get()->unregisterPacketType("ListHosts");
Common::RequestManager::get()->unregisterPacketType("ListUsers");
Common::RequestManager::get()->unregisterPacketType("Log");
diff --git a/src/Core/RequestHandlers/DaemonListRequestHandler.cpp b/src/Core/RequestHandlers/DaemonListRequestHandler.cpp
index dcf9f53..c20627f 100644
--- a/src/Core/RequestHandlers/DaemonListRequestHandler.cpp
+++ b/src/Core/RequestHandlers/DaemonListRequestHandler.cpp
@@ -20,18 +20,22 @@
#include "DaemonListRequestHandler.h"
#include "../ConnectionManager.h"
#include <Common/Logger.h>
+#include <Common/XmlPacket.h>
#include <Net/Connection.h>
-#include <Net/Packets/ErrorPacket.h>
-#include <Net/Packets/HostListPacket.h>
namespace Mad {
namespace Core {
namespace RequestHandlers {
-void DaemonListRequestHandler::handlePacket(Net::Connection *connection, const Net::Packet &packet) {
- if(packet.getType() != Net::Packet::LIST_DAEMONS) {
+void DaemonListRequestHandler::handlePacket(Net::Connection *connection, uint16_t requestId, const Common::XmlPacket &packet) {
+ if(packet.getType() != "ListHosts") {
Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet.");
- connection->send(Net::Packets::ErrorPacket(Net::Packet::ERROR, packet.getRequestId(), Common::Exception(Common::Exception::UNEXPECTED_PACKET)));
+
+ Common::XmlPacket ret;
+ ret.setType("Error");
+ ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+
+ connection->send(ret.encode(requestId));
signalFinished().emit();
return;
@@ -39,7 +43,21 @@ void DaemonListRequestHandler::handlePacket(Net::Connection *connection, const N
// TODO Require authentication
- connection->send(Net::Packets::HostListPacket(Net::Packet::OK, packet.getRequestId(), ConnectionManager::get()->getDaemonList()));
+ Common::XmlPacket ret;
+ ret.setType("OK");
+ ret.addList("hosts");
+
+ std::vector<Common::HostInfo> daemons = ConnectionManager::get()->getDaemonList();
+
+ for(std::vector<Common::HostInfo>::iterator daemon = daemons.begin(); daemon != daemons.end(); ++daemon) {
+ ret["hosts"].addEntry();
+
+ ret["hosts"].back().add("name", daemon->getName());
+ ret["hosts"].back().add("address", daemon->getIP());
+ ret["hosts"].back().add("state", daemon->getState());
+ }
+
+ connection->send(ret.encode(requestId));
signalFinished().emit();
}
diff --git a/src/Core/RequestHandlers/DaemonListRequestHandler.h b/src/Core/RequestHandlers/DaemonListRequestHandler.h
index 205ad02..6fe2517 100644
--- a/src/Core/RequestHandlers/DaemonListRequestHandler.h
+++ b/src/Core/RequestHandlers/DaemonListRequestHandler.h
@@ -20,15 +20,15 @@
#ifndef MAD_CORE_REQUESTHANDLERS_DAEMONLISTREQUESTHANDLER_H_
#define MAD_CORE_REQUESTHANDLERS_DAEMONLISTREQUESTHANDLER_H_
-#include <Common/RequestHandler.h>
+#include <Common/XmlRequestHandler.h>
namespace Mad {
namespace Core {
namespace RequestHandlers {
-class DaemonListRequestHandler : public Common::RequestHandler {
+class DaemonListRequestHandler : public Common::XmlRequestHandler {
protected:
- virtual void handlePacket(Net::Connection *connection, const Net::Packet &packet);
+ virtual void handlePacket(Net::Connection *connection, uint16_t requestId, const Common::XmlPacket &packet);
public:
DaemonListRequestHandler() {}
diff --git a/src/Core/Requests/DaemonStateUpdateRequest.cpp b/src/Core/Requests/DaemonStateUpdateRequest.cpp
index 00e0bdf..c00468e 100644
--- a/src/Core/Requests/DaemonStateUpdateRequest.cpp
+++ b/src/Core/Requests/DaemonStateUpdateRequest.cpp
@@ -19,23 +19,27 @@
#include "DaemonStateUpdateRequest.h"
#include <Net/Connection.h>
-#include <Net/Packets/HostStatePacket.h>
namespace Mad {
namespace Core {
namespace Requests {
void DaemonStateUpdateRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
- connection->send(Net::Packets::HostStatePacket(Net::Packet::DAEMON_STATE_UPDATE, requestId, name, state));
+ Common::XmlPacket packet;
+
+ packet.setType("UpdateHostState");
+ packet.add("name", name);
+ packet.add("state", state);
+ connection->send(packet.encode(requestId));
}
-void DaemonStateUpdateRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
- if(packet.getType() != Net::Packet::OK) {
+void DaemonStateUpdateRequest::handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet) {
+ if(packet.getType() != "OK") {
finishWithError(Common::Exception(Common::Exception::UNEXPECTED_PACKET));
return; // TODO Logging
}
- finish();
+ finish(packet);
}
}
diff --git a/src/Core/Requests/DaemonStateUpdateRequest.h b/src/Core/Requests/DaemonStateUpdateRequest.h
index 9a1c8f0..84c23e8 100644
--- a/src/Core/Requests/DaemonStateUpdateRequest.h
+++ b/src/Core/Requests/DaemonStateUpdateRequest.h
@@ -20,24 +20,24 @@
#ifndef MAD_CORE_REQUESTS_DAEMONSTATEUPDATEREQUEST_H_
#define MAD_CORE_REQUESTS_DAEMONSTATEUPDATEREQUEST_H_
-#include <Common/Request.h>
+#include <Common/XmlRequest.h>
#include <Common/HostInfo.h>
namespace Mad {
namespace Core {
namespace Requests {
-class DaemonStateUpdateRequest : public Common::Request<> {
+class DaemonStateUpdateRequest : public Common::XmlRequest {
private:
std::string name;
Common::HostInfo::State state;
protected:
virtual void sendRequest(Net::Connection *connection, uint16_t requestId);
- virtual void handlePacket(Net::Connection *connection, const Net::Packet &packet);
+ virtual void handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet);
public:
- DaemonStateUpdateRequest(const std::string &name0, Common::HostInfo::State state0) : Common::Request<>(slot_type()), name(name0), state(state0) {}
+ DaemonStateUpdateRequest(const std::string &name0, Common::HostInfo::State state0) : Common::XmlRequest(slot_type()), name(name0), state(state0) {}
};
}
diff --git a/src/Net/Packets/HostListPacket.cpp b/src/Net/Packets/HostListPacket.cpp
deleted file mode 100644
index 659b621..0000000
--- a/src/Net/Packets/HostListPacket.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * HostListPacket.cpp
- *
- * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "HostListPacket.h"
-#include <cstring>
-#include <sstream>
-
-namespace Mad {
-namespace Net {
-namespace Packets {
-
-void HostListPacket::assemblePacket() {
- std::string str;
-
- for(std::vector<Common::HostInfo>::iterator host = hostList.begin(); host != hostList.end(); ++host)
- str += host->getName() + "\n" + host->getIP() + "\n";
-
- setLength(sizeof(uint16_t) + sizeof(HostData)*hostList.size() + str.length());
-
- nHosts = (uint16_t*)rawData->data;
- hostData = (HostData*)(rawData->data + sizeof(uint16_t));
- charData = (char*)(rawData->data + sizeof(uint16_t) + sizeof(HostData)*hostList.size());
-
- std::memcpy(charData, str.c_str(), str.length());
-
- *nHosts = htons(hostList.size());
-
- for(size_t i = 0; i < hostList.size(); ++i) {
- hostData[i].state = htons((uint16_t)hostList[i].getState());
- }
-}
-
-void HostListPacket::parsePacket() {
- hostList.clear();
-
- if(getLength() < sizeof(uint16_t))
- return;
-
- nHosts = (uint16_t*)rawData->data;
- hostList.resize(ntohs(*nHosts));
-
- if(getLength() < sizeof(uint16_t) + sizeof(HostData)*hostList.size())
- setLength(sizeof(uint16_t) + sizeof(HostData)*hostList.size());
-
- nHosts = (uint16_t*)rawData->data;
- hostData = (HostData*)(rawData->data + sizeof(uint16_t));
- charData = (char*)(rawData->data + sizeof(uint16_t) + sizeof(HostData)*hostList.size());
-
- std::istringstream stream(std::string(charData, getLength() - (sizeof(uint16_t)+sizeof(HostData)*hostList.size())));
-
- for(size_t i = 0; i < hostList.size(); ++i) {
- hostList[i].setState((Common::HostInfo::State)ntohs(hostData[i].state));
-
- if(!stream.eof()) {
- std::string str;
-
- std::getline(stream, str);
- hostList[i].setName(str);
- std::getline(stream, str);
- hostList[i].setIP(str);
- }
- }
-}
-
-}
-}
-}
diff --git a/src/Net/Packets/HostListPacket.h b/src/Net/Packets/HostListPacket.h
deleted file mode 100644
index 2cec9b0..0000000
--- a/src/Net/Packets/HostListPacket.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * HostListPacket.h
- *
- * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef MAD_NET_PACKETS_HOSTLISTPACKET_H_
-#define MAD_NET_PACKETS_HOSTLISTPACKET_H_
-
-#include "../Packet.h"
-#include <Common/HostInfo.h>
-
-#include <vector>
-
-
-namespace Mad {
-namespace Net {
-namespace Packets {
-
-class HostListPacket : public Packet {
- protected:
- struct HostData {
- uint16_t state;
- };
-
- uint16_t *nHosts;
- HostData *hostData;
- char *charData;
-
- std::vector<Common::HostInfo> hostList;
-
- void assemblePacket();
- void parsePacket();
-
- public:
- HostListPacket(Type type, uint16_t requestId, const std::vector<Common::HostInfo> &hosts) : Packet(type, requestId), hostList(hosts) {
- assemblePacket();
- }
-
- HostListPacket(const Packet &p) : Packet(p) {
- parsePacket();
- }
-
- HostListPacket& operator=(const Packet &p) {
- Packet::operator=(p);
- parsePacket();
-
- return *this;
- }
-
- HostListPacket& operator=(const HostListPacket &p) {
- Packet::operator=(p);
- parsePacket();
-
- return *this;
- }
-
- const std::vector<Common::HostInfo>& getHostInfo() const {
- return hostList;
- }
-};
-
-}
-}
-}
-
-#endif /* MAD_NET_PACKETS_HOSTLISTPACKET_H_ */
diff --git a/src/Net/Packets/HostStatePacket.cpp b/src/Net/Packets/HostStatePacket.cpp
deleted file mode 100644
index d34d9d5..0000000
--- a/src/Net/Packets/HostStatePacket.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * HostStatePacket.cpp
- *
- * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "HostStatePacket.h"
-
-namespace Mad {
-namespace Net {
-namespace Packets {
-
-HostStatePacket::HostStatePacket(Type type, uint16_t requestId, const std::string &name, Common::HostInfo::State state)
-: Packet(type, requestId)
-{
- setLength(sizeof(HostStateData) + name.length());
- hostStateData = (HostStateData*)&rawData->data;
-
- hostStateData->state = htons(state);
-
- std::memcpy(hostStateData->name, name.c_str(), name.length());
-}
-
-HostStatePacket& HostStatePacket::operator=(const Packet &p) {
- Packet::operator=(p);
-
- if(getLength() < sizeof(HostStateData))
- setLength(sizeof(HostStateData));
-
- hostStateData = (HostStateData*)&rawData->data;
-
- return *this;
-}
-
-}
-}
-}
diff --git a/src/Net/Packets/HostStatePacket.h b/src/Net/Packets/HostStatePacket.h
deleted file mode 100644
index 5a34275..0000000
--- a/src/Net/Packets/HostStatePacket.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * HostStatePacket.h
- *
- * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef MAD_NET_PACKETS_HOSTSTATEPACKET_H_
-#define MAD_NET_PACKETS_HOSTSTATEPACKET_H_
-
-#include "../Packet.h"
-#include <Common/HostInfo.h>
-
-#include <string>
-
-namespace Mad {
-namespace Net {
-namespace Packets {
-
-class HostStatePacket : public Packet {
- protected:
- struct HostStateData {
- uint16_t state;
- uint8_t name[0];
- };
-
- HostStateData *hostStateData;
-
- public:
- HostStatePacket(Type type, uint16_t requestId, const std::string &name, Common::HostInfo::State state);
-
- HostStatePacket(const Packet &p) : Packet(p) {
- if(getLength() < sizeof(HostStateData))
- setLength(sizeof(HostStateData));
-
- hostStateData = (HostStateData*)&rawData->data;
- }
-
- HostStatePacket(const HostStatePacket &p) : Packet(p) {
- hostStateData = (HostStateData*)&rawData->data;
- }
-
- HostStatePacket& operator=(const Packet &p);
-
- HostStatePacket& operator=(const HostStatePacket &p) {
- return (*this = (Packet)p);
- }
-
- std::string getName() const {
- return std::string((char*)hostStateData->name, getLength()-sizeof(HostStateData));
- }
-
- Common::HostInfo::State getState() const {
- return (Common::HostInfo::State)ntohs(hostStateData->state);
- }
-};
-
-}
-}
-}
-
-#endif /* MAD_NET_PACKETS_HOSTSTATEPACKET_H_ */
diff --git a/src/Net/Packets/Makefile.am b/src/Net/Packets/Makefile.am
index 9ce8f9d..99030d4 100644
--- a/src/Net/Packets/Makefile.am
+++ b/src/Net/Packets/Makefile.am
@@ -1,4 +1,4 @@
noinst_LTLIBRARIES = libpackets.la
-libpackets_la_SOURCES = ErrorPacket.cpp FSInfoPacket.cpp HostListPacket.cpp HostStatePacket.cpp
+libpackets_la_SOURCES = ErrorPacket.cpp FSInfoPacket.cpp
-noinst_HEADERS = ErrorPacket.h FSInfoPacket.h HostListPacket.h HostStatePacket.h
+noinst_HEADERS = ErrorPacket.h FSInfoPacket.h
diff --git a/src/Net/Packets/Makefile.in b/src/Net/Packets/Makefile.in
index 239e753..551550a 100644
--- a/src/Net/Packets/Makefile.in
+++ b/src/Net/Packets/Makefile.in
@@ -50,8 +50,7 @@ CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libpackets_la_LIBADD =
-am_libpackets_la_OBJECTS = ErrorPacket.lo FSInfoPacket.lo \
- HostListPacket.lo HostStatePacket.lo
+am_libpackets_la_OBJECTS = ErrorPacket.lo FSInfoPacket.lo
libpackets_la_OBJECTS = $(am_libpackets_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
@@ -217,8 +216,8 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = libpackets.la
-libpackets_la_SOURCES = ErrorPacket.cpp FSInfoPacket.cpp HostListPacket.cpp HostStatePacket.cpp
-noinst_HEADERS = ErrorPacket.h FSInfoPacket.h HostListPacket.h HostStatePacket.h
+libpackets_la_SOURCES = ErrorPacket.cpp FSInfoPacket.cpp
+noinst_HEADERS = ErrorPacket.h FSInfoPacket.h
all: all-am
.SUFFIXES:
@@ -272,8 +271,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ErrorPacket.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FSInfoPacket.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HostListPacket.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HostStatePacket.Plo@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<