mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00

This adds two example plugins within testing/builtin-plugins/Files: * protocol-plugin copied over from testing/btest/plugins/protocol-plugin * py-lib-plugin that embeds Python to have a dependency on an external shared library which was already available in CI and fun to use, too. Closes #2837
18 lines
282 B
C++
18 lines
282 B
C++
module Python;
|
|
|
|
%%{
|
|
extern "C" {
|
|
#include <Python.h>
|
|
}
|
|
%%}
|
|
|
|
function version%(%): string
|
|
%{
|
|
return zeek::make_intrusive<zeek::StringVal>(Py_GetVersion());
|
|
%}
|
|
|
|
function run_simple_string%(s: string%): bool
|
|
%{
|
|
PyRun_SimpleString(s->CheckString());
|
|
return zeek::val_mgr->True();
|
|
%}
|