Update OpenFlow API and events.

Events now generally carry the unique ID of the backend that is given
during initialization; there are a few more functions and other
bugfixes.

A few netcontrol tests are still broken (mostly due to a pcap update in
msater).
This commit is contained in:
Johanna Amann 2016-02-11 13:09:20 -08:00
parent 5e2ec25a38
commit 9f3c0c9bb4
19 changed files with 186 additions and 95 deletions

View file

@ -12,7 +12,7 @@ event bro_init()
of_controller$state$ryu_debug=T;
OpenFlow::flow_clear(of_controller);
OpenFlow::flow_mod(of_controller, [], [$cookie=1, $command=OpenFlow::OFPFC_ADD, $actions=[$out_ports=vector(3, 7)]]);
OpenFlow::flow_mod(of_controller, [], [$cookie=OpenFlow::generate_cookie(1), $command=OpenFlow::OFPFC_ADD, $actions=[$out_ports=vector(3, 7)]]);
}
event connection_established(c: connection)
@ -21,7 +21,7 @@ event connection_established(c: connection)
local match_rev = OpenFlow::match_conn(c$id, T);
local flow_mod: OpenFlow::ofp_flow_mod = [
$cookie=42,
$cookie=OpenFlow::generate_cookie(42),
$command=OpenFlow::OFPFC_ADD,
$idle_timeout=30,
$priority=5
@ -31,7 +31,7 @@ event connection_established(c: connection)
OpenFlow::flow_mod(of_controller, match_rev, flow_mod);
}
event OpenFlow::flow_mod_success(match: OpenFlow::ofp_match, flow_mod: OpenFlow::ofp_flow_mod, msg: string)
event OpenFlow::flow_mod_success(name: string, match: OpenFlow::ofp_match, flow_mod: OpenFlow::ofp_flow_mod, msg: string)
{
print "Flow_mod_success";
}