#include <sys/types.h>
-#include <safe-buffer.h>
-
#include <dpl/exception.h>
-
#include <generic-event.h>
+#include <dpl/raw-buffer.h>
+#include <ckm/ckm-type.h>
+#include <credentials.h>
extern "C" {
struct msghdr;
typedef int InterfaceID;
-struct Credentials {
- uid_t uid;
- std::string smackLabel;
-};
-
struct ConnectionID {
int sock; // This is decriptor used for connection
int counter; // Unique handler per socket
struct GenericSocketManager;
struct GenericSocketService {
- typedef std::string SmackLabel;
typedef std::string ServiceHandlerPath;
struct ServiceDescription {
ServiceDescription(const char *path,
, useSendMsg(useSendMsg)
{}
- SmackLabel smackLabel; // Smack label for socket
+ Label smackLabel; // Smack label for socket
InterfaceID interfaceID; // All data from serviceHandlerPath will be marked with this interfaceHandler
ServiceHandlerPath serviceHandlerPath; // Path to file
bool useSendMsg;
struct ReadEvent : public GenericEvent {
ConnectionID connectionID;
- SafeBuffer rawBuffer;
+ RawBuffer rawBuffer;
};
struct CloseEvent : public GenericEvent {
virtual void Event(const ReadEvent &event) = 0;
virtual void Event(const CloseEvent &event) = 0;
+ virtual void Start() = 0;
+ virtual void Stop() = 0;
+
GenericSocketService() : m_serviceManager(NULL) {}
virtual ~GenericSocketService(){}
protected:
virtual void MainLoop() = 0;
virtual void RegisterSocketService(GenericSocketService *ptr) = 0;
virtual void Close(ConnectionID connectionID) = 0;
- virtual void Write(ConnectionID connectionID, const SafeBuffer &rawBuffer) = 0;
+ virtual void Write(ConnectionID connectionID, const RawBuffer &rawBuffer) = 0;
virtual ~GenericSocketManager(){}
};