mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
add broker output plugin for openflow (at the moment we more or less
just send the flow_mod event along - there still is no feedback) and add a testcase for it. Also fix a few other small problems.
This commit is contained in:
parent
1fb7f5121e
commit
a403dbd83e
9 changed files with 195 additions and 15 deletions
|
@ -1,16 +1,18 @@
|
|||
##! OpenFlow module that outputs flow-modification commands
|
||||
##! to a Bro log file.
|
||||
|
||||
module OpenFlow;
|
||||
|
||||
@load base/frameworks/openflow
|
||||
@load base/frameworks/logging
|
||||
|
||||
module OpenFlow;
|
||||
|
||||
export {
|
||||
redef enum Plugin += {
|
||||
LOG,
|
||||
OFLOG,
|
||||
};
|
||||
|
||||
redef enum Log::ID += { LOG };
|
||||
|
||||
## Log controller constructor.
|
||||
##
|
||||
## dpid: OpenFlow switch datapath id.
|
||||
|
@ -42,12 +44,12 @@ export {
|
|||
|
||||
event bro_init() &priority=5
|
||||
{
|
||||
Log::create_stream(LOG, [$columns=Info, $ev=log_openflow, $path="openflow"]);
|
||||
Log::create_stream(OpenFlow::LOG, [$columns=Info, $ev=log_openflow, $path="openflow"]);
|
||||
}
|
||||
|
||||
function log_flow_mod(state: ControllerState, match: ofp_match, flow_mod: OpenFlow::ofp_flow_mod): bool
|
||||
{
|
||||
Log::write(LOG, [$ts=network_time(), $dpid=state$log_dpid, $match=match, $flow_mod=flow_mod]);
|
||||
Log::write(OpenFlow::LOG, [$ts=network_time(), $dpid=state$log_dpid, $match=match, $flow_mod=flow_mod]);
|
||||
|
||||
return T;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue