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:
Johanna Amann 2015-04-20 16:05:27 -07:00
parent 1fb7f5121e
commit a403dbd83e
9 changed files with 195 additions and 15 deletions

View file

@ -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;
}