Feature/bundle support (#15)

* openflow: Add bundle support

* openflow: Add bundle message generator and parser

* openflow: Add bundle API
This commit is contained in:
Eishun Kondoh 2019-03-04 04:03:25 +09:00 committed by Eishun Kondoh
parent 99647fa9aa
commit f3d2ab1fb7
9 changed files with 388 additions and 11 deletions

View file

@ -63,14 +63,18 @@ defmodule LearningSwitch.Ofctl do
end
defp init_flow_tables(datapath_id) do
:ok = onf_bundle_open(datapath_id, bundle_id: 1, flags: [:atomic, :ordered])
for flow_options <- [
add_default_broadcast_flow_entry(),
add_default_flooding_flow_entry(),
add_multicast_mac_drop_flow_entry(),
add_ipv6_multicast_mac_drop_flow_entry(),
add_default_forwarding_flow_entry()] do
send_flow_mod_add(datapath_id, flow_options)
send_flow_mod_add(datapath_id, Keyword.merge(flow_options, [bundle_id: 1, bundle_flags: [:atomic, :ordered]]))
end
:ok = onf_bundle_commit(datapath_id, bundle_id: 1, flags: [:atomic, :ordered])
end
defp add_forwarding_flow_and_packet_out(packet_in, state) do

View file

@ -1,7 +1,7 @@
%{
"binpp": {:git, "https://github.com/jtendo/binpp.git", "64bd68d215d1a6cd35871e7c134d7fe2e46214ea", [branch: "master"]},
"eovsdb": {:git, "https://github.com/shun159/eovsdb.git", "1ff1572708d72fd25631c681f2102407903252a3", [branch: "master"]},
"jsone": {:git, "https://github.com/sile/jsone.git", "eecc9666c7165e1870b78a7a762549ae8d1c391b", [tag: "1.2.1"]},
"ranch": {:hex, :ranch, "1.4.0", "10272f95da79340fa7e8774ba7930b901713d272905d0012b06ca6d994f8826b", [], [], "hexpm"},
"jsone": {:git, "https://github.com/sile/jsone.git", "b23d312a5ed051ea7ad0989a9f2cb1a9c3f9a502", [tag: "1.4.6"]},
"ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm"},
"uuid": {:git, "https://github.com/avtobiff/erlang-uuid.git", "585c2474afb4a597ae8c8bf6d21e5a9c73f18e0b", [tag: "v0.5.0"]},
}