summaryrefslogtreecommitdiffstats
path: root/lib/CommLayer/CommLayerServerSocket.h
diff options
context:
space:
mode:
authorZdenek Prikryl <zprikryl@redhat.com>2009-05-20 11:16:33 +0200
committerZdenek Prikryl <zprikryl@redhat.com>2009-05-20 11:16:33 +0200
commit821c30ceca2885836fb2aeafaa03ab0c0f1b1809 (patch)
treeed60a68f5ca8067cc9b7f1285c1b15dd648e7238 /lib/CommLayer/CommLayerServerSocket.h
parentbc12d93a46c87ccf647f83b4eafd4378d19b9e29 (diff)
downloadabrt-821c30ceca2885836fb2aeafaa03ab0c0f1b1809.tar.gz
abrt-821c30ceca2885836fb2aeafaa03ab0c0f1b1809.tar.xz
abrt-821c30ceca2885836fb2aeafaa03ab0c0f1b1809.zip
initial unix socket interface
Diffstat (limited to 'lib/CommLayer/CommLayerServerSocket.h')
-rw-r--r--lib/CommLayer/CommLayerServerSocket.h36
1 files changed, 33 insertions, 3 deletions
diff --git a/lib/CommLayer/CommLayerServerSocket.h b/lib/CommLayer/CommLayerServerSocket.h
index d5604f19..e816adaf 100644
--- a/lib/CommLayer/CommLayerServerSocket.h
+++ b/lib/CommLayer/CommLayerServerSocket.h
@@ -1,10 +1,40 @@
#include "CommLayerServer.h"
+#include <glib.h>
-class CCommLayerServerSocket
-: public CCommLayerServer
+#define SOCKET_PATH "/tmp/abrt.socket"
+
+#define MESSAGE_DELETE_DEBUG_DUMP "(DELETE_DEBUG_DUMP)"
+#define MESSAGE_GET_CRASH_INFOS "(GET_CRASH_INFOS)"
+#define MESSAGE_REPORT "(REPORT)"
+#define MESSAGE_CREATE_REPORT "(CREATE_REPORT)"
+
+class CCommLayerServerSocket : public CCommLayerServer
{
private:
+ typedef std::map<int, GIOChannel*> map_clinet_channels_t;
+
+ int m_nSocket;
+ GIOChannel* m_pGSocket;
+ map_clinet_channels_t m_mapClientChannels;
+
+ void Send(const std::string& pData, GIOChannel *pDestination);
+
+ static gboolean server_socket_cb(GIOChannel *source, GIOCondition condition, gpointer data);
+ static gboolean client_socket_cb(GIOChannel *source, GIOCondition condition, gpointer data);
+
+ std::string GetSenderUID(int pSenderSocket);
+ void ProcessMessage(const std::string& pMessage, GIOChannel *pSource);
+
public:
CCommLayerServerSocket();
- ~CCommLayerServerSocket();
+ virtual ~CCommLayerServerSocket();
+
+ virtual vector_crash_infos_t GetCrashInfos(const std::string &pDBusSender);
+ virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pDBusSender);
+ virtual bool Report(map_crash_report_t pReport);
+ virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender);
+
+ virtual void Crash(const std::string& arg1);
+ virtual void AnalyzeComplete(map_crash_report_t arg1);
+ virtual void Error(const std::string& arg1);
};