]> git.saurik.com Git - apple/securityd.git/blob - src/SharedMemoryServer.h
securityd-36489.tar.gz
[apple/securityd.git] / src / SharedMemoryServer.h
1 #ifndef __SHARED_MEMORY_SERVER__
2 #define __SHARED_MEMORY_SERVER__
3
4
5
6 #include <string>
7 #include <stdlib.h>
8 #include <securityd_client/SharedMemoryCommon.h>
9
10 class SharedMemoryServer
11 {
12 protected:
13 std::string mSegmentName, mFileName;
14 size_t mSegmentSize;
15
16 u_int8_t* mSegment;
17 u_int8_t* mDataArea;
18 u_int8_t* mDataPtr;
19 u_int8_t* mDataMax;
20
21 void WriteOffset (SegmentOffsetType offset);
22 void WriteData (const void* data, SegmentOffsetType length);
23
24 public:
25 SharedMemoryServer (const char* segmentName, SegmentOffsetType segmentSize);
26 virtual ~SharedMemoryServer ();
27
28 void WriteMessage (SegmentOffsetType domain, SegmentOffsetType event, const void *message, SegmentOffsetType messageLength);
29
30 const char* GetSegmentName ();
31 size_t GetSegmentSize ();
32
33 SegmentOffsetType GetProducerOffset ();
34 void SetProducerOffset (SegmentOffsetType producerOffset);
35 };
36
37
38
39 #endif