]> git.saurik.com Git - apple/security.git/blobdiff - securityd/src/SharedMemoryServer.h
Security-57031.1.35.tar.gz
[apple/security.git] / securityd / src / SharedMemoryServer.h
diff --git a/securityd/src/SharedMemoryServer.h b/securityd/src/SharedMemoryServer.h
new file mode 100644 (file)
index 0000000..6e17b35
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef __SHARED_MEMORY_SERVER__
+#define __SHARED_MEMORY_SERVER__
+
+
+
+#include <string>
+#include <stdlib.h>
+#include <securityd_client/SharedMemoryCommon.h>
+
+class SharedMemoryServer
+{
+protected:
+       std::string mSegmentName, mFileName;
+       size_t mSegmentSize;
+       
+       u_int8_t* mSegment;
+       u_int8_t* mDataArea;
+       u_int8_t* mDataPtr;
+       u_int8_t* mDataMax;
+       
+       void WriteOffset (SegmentOffsetType offset);
+       void WriteData (const void* data, SegmentOffsetType length);
+       
+public:
+       SharedMemoryServer (const char* segmentName, SegmentOffsetType segmentSize);
+       virtual ~SharedMemoryServer ();
+       
+       void WriteMessage (SegmentOffsetType domain, SegmentOffsetType event, const void *message, SegmentOffsetType messageLength);
+       
+       const char* GetSegmentName ();
+       size_t GetSegmentSize ();
+       
+       SegmentOffsetType GetProducerOffset ();
+       void SetProducerOffset (SegmentOffsetType producerOffset);
+};
+
+
+
+#endif