Because Peep provides a solid platform for data gathering and will process a considerable amount of data while monitoring, a new plug-in architecture was introduced with the 0.5.0 release. The transition to XML messaging opened up the pathway to easily piggy-backing additional data for real-time or post-processing on a central server.
Upon receipt of an XML event, the server processes the event and parses the XML into a NOTICE structure, defined in notice.h. After the parse, the event is fed into the sound engine and then the code hook function, executeEventNoticeHook, is executed. The function is fed the original XML data and the pre-defined NOTICE data structure filled from the parse.
To add a plug-in, a function call should be added into the executeEventNoticeHook function to call the plug-in routines. Plug-in developers need not worry if Peep doesn't understand how to parse the extra information piggy-backed onto the initial message. peepd will attempt to fill out the NOTICE structure as best as it can and provide the original XML message for additional parsing.
It is important to note that peepd excutes the code hook function inline while processing packets. That means that a function that occupies a considerable amount of processing time will adversely affect it's performance. To circumvent that, data can be written to a log file and processed by another program. Or, quick operations can be performed. The code-hook is also executed in real-time, allowing for both real-time and post-processing. The code-hook will most likely be called by multiple threads, so some basic thread locking might be in order. Helper routines are supplied in thread.c.