summaryrefslogtreecommitdiffstats
path: root/inc/CrashTypesSocket.h
diff options
context:
space:
mode:
authorZdenek Prikryl <zprikryl@redhat.com>2009-06-17 15:16:37 +0200
committerZdenek Prikryl <zprikryl@redhat.com>2009-06-17 15:16:37 +0200
commite81b4be220714cdd7b03aafe36ced809684e4118 (patch)
tree026f6a3876d4534542a691285a1759d172b51226 /inc/CrashTypesSocket.h
parentcecaf1e1c25ec33848c9ba03ec5820c07392dfda (diff)
downloadabrt-e81b4be220714cdd7b03aafe36ced809684e4118.tar.gz
abrt-e81b4be220714cdd7b03aafe36ced809684e4118.tar.xz
abrt-e81b4be220714cdd7b03aafe36ced809684e4118.zip
added description of communication
Diffstat (limited to 'inc/CrashTypesSocket.h')
-rw-r--r--inc/CrashTypesSocket.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/inc/CrashTypesSocket.h b/inc/CrashTypesSocket.h
index 0c761545..45b7b295 100644
--- a/inc/CrashTypesSocket.h
+++ b/inc/CrashTypesSocket.h
@@ -1,3 +1,24 @@
+/*
+ CrashTypesSocket.h - contains inline functions for socket communication
+
+ Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com)
+ Copyright (C) 2009 RedHat 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#ifndef SOCKETCRASHTYPES_H_
#define SOCKETCRASHTYPES_H_
@@ -5,6 +26,45 @@
#include <sstream>
#include <stdlib.h>
+/**
+ * A request GET_CRASH_INFOS has the following form:
+ * message -> MESSAGE_GET_CRASH_INFOS
+ *
+ * Example:
+ *
+ * (GET_CRASH_INFOS)
+ * \23
+ *
+ *
+ * A request DELETE_DEBUG_DUMP and CREATE_REPORT has following form:
+ * message -> MESSAGE_TYPE data END_MARKER
+ * MESSAGE_TYPE -> MESSAGE_CREATE_REPORT | MESSAGE_DELETE_DEBUG_DUMP
+ * data -> UUID
+ *
+ * Example:
+ * (DELETE_DEBUG_DUMP)
+ * 1135a3f35bccb543
+ * \23
+ *
+ *
+ * A reply to the GET_CRASH_INFOS, CREATE_REPORT and a request REPORT
+ * has the following form:
+ *
+ * message -> MESSAGE_TYPE data END_MARKER
+ * MESSAGE_TYPE -> MESSAGE_GET_CRASH_INFOS | MESSAGE_REPORT | MESSAGE_CREATE_REPORT
+ * data -> (count of items) item
+ * item -> (length of member)member(length of member)memger...
+ *
+ * Example:
+ *
+ * (REPORT)
+ * (2)
+ * (4)aaaa(1)t(1)y(5)hello
+ * (3)xxx(1)s(1)n(5)world
+ * \23
+ *
+ * The replies has same header as the requests.
+ */
#define MESSAGE_DELETE_DEBUG_DUMP "(DELETE_DEBUG_DUMP)"
#define MESSAGE_GET_CRASH_INFOS "(GET_CRASH_INFOS)"
@@ -66,6 +126,7 @@ inline int get_number_from_string(const std::string& pMessage, int& len)
return atoi(sNumber.c_str());
}
+//TODO: remove constant 4 and place it in a message
inline map_crash_data_t string_to_crash_data(const std::string& pMessage, int& len)
{
map_crash_data_t ci;