]> git.saurik.com Git - apple/security.git/blob - SecurityServer/eventlistener.h
Security-177.tar.gz
[apple/security.git] / SecurityServer / eventlistener.h
1 #ifndef _H_EVENTLISTENER
2 #define _H_EVENTLISTENER
3
4 #include <Security/ssclient.h>
5
6
7
8 #undef verify
9
10 namespace Security {
11 namespace SecurityServer {
12
13
14 class EventListener
15 {
16 protected:
17 ClientSession mClientSession;
18 CFMachPortRef mMachPortRef;
19 CFRunLoopSourceRef mRunLoopSourceRef;
20
21 static void Callback (CFMachPortRef port, void *msg, CFIndex size, void *info);
22 static OSStatus ProcessMessage (Listener::Domain domain, Listener::Event event, const void *data, size_t dataLength, void *context);
23 void HandleCallback (CFMachPortRef port, void *msg, CFIndex size);
24 void HandleMessage ();
25 void Initialize ();
26
27 public:
28 EventListener (CssmAllocator &standard = CssmAllocator::standard(), CssmAllocator &returning = CssmAllocator::standard());
29 virtual ~EventListener ();
30
31 void RequestEvents (Listener::Domain domain, Listener::EventMask eventMask);
32 virtual void EventReceived (Listener::Domain domain, Listener::Event event, const void* data, size_t dataLength);
33 };
34
35
36 }; // end namespace SecurityServer
37 }; // end namespace Security
38
39
40
41 #endif