mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

This is based on commit 2731def9159247e6da8a3191783c89683363689c from the zeek-docs repo.
39 lines
808 B
Text
39 lines
808 B
Text
module NetControl;
|
|
|
|
export {
|
|
## Instantiates the plugin.
|
|
global create_skeleton: function(argument: string) : PluginState;
|
|
}
|
|
|
|
function skeleton_name(p: PluginState) : string
|
|
{
|
|
return "NetControl skeleton plugin";
|
|
}
|
|
|
|
function skeleton_add_rule_fun(p: PluginState, r: Rule) : bool
|
|
{
|
|
print "add", r;
|
|
event NetControl::rule_added(r, p);
|
|
return T;
|
|
}
|
|
|
|
function skeleton_remove_rule_fun(p: PluginState, r: Rule, reason: string &default="") : bool
|
|
{
|
|
print "remove", r;
|
|
event NetControl::rule_removed(r, p);
|
|
return T;
|
|
}
|
|
|
|
global skeleton_plugin = Plugin(
|
|
$name = skeleton_name,
|
|
$can_expire = F,
|
|
$add_rule = skeleton_add_rule_fun,
|
|
$remove_rule = skeleton_remove_rule_fun
|
|
);
|
|
|
|
function create_skeleton(argument: string) : PluginState
|
|
{
|
|
local p = PluginState($plugin=skeleton_plugin);
|
|
|
|
return p;
|
|
}
|