base/frameworks/openflow/main.bro
-
OpenFlow
Bro’s OpenFlow control framework.
This plugin-based framework allows to control OpenFlow capable
switches by implementing communication to an OpenFlow controller
via plugins. The framework has to be instantiated via the new function
in one of the plugins. This framework only offers very low-level
functionality; if you want to use OpenFlow capable switches, e.g.,
for shunting, please look at the NetControl framework, which provides higher
level functions and can use the OpenFlow framework as a backend.
Detailed Interface
Events
-
OpenFlow::controller_activated
-
Event that is raised once a controller finishes initialization
and is completely activated.
Name: | Unique name of this controller instance. |
Controller: | The controller that finished activation. |
-
OpenFlow::flow_mod_failure
-
Reports an error while installing a flow Rule.
Name: | The unique name of the OpenFlow controller from which this event originated. |
Match: | The ofp_match record which describes the flow to match. |
Flow_mod: | The openflow flow_mod record which describes the action to take. |
Msg: | Message to describe the event. |
-
OpenFlow::flow_mod_success
-
Event confirming successful modification of a flow rule.
Name: | The unique name of the OpenFlow controller from which this event originated. |
Match: | The ofp_match record which describes the flow to match. |
Flow_mod: | The openflow flow_mod record which describes the action to take. |
Msg: | An optional informational message by the plugin. |
-
OpenFlow::flow_removed
-
Reports that a flow was removed by the switch because of either the hard or the idle timeout.
This message is only generated by controllers that indicate that they support flow removal
in supports_flow_removed.
Name: | The unique name of the OpenFlow controller from which this event originated. |
Match: | The ofp_match record which was used to create the flow. |
Cookie: | The cookie that was specified when creating the flow. |
Priority: | The priority that was specified when creating the flow. |
Reason: | The reason for flow removal (OFPRR_*). |
Duration_sec: | Duration of the flow in seconds. |
Packet_count: | Packet count of the flow. |
Byte_count: | Byte count of the flow. |
Functions
-
OpenFlow::controller_init_done
-
Function to signal that a controller finished activation and is
ready to use. Will throw the OpenFlow::controller_activated
event.
-
OpenFlow::flow_clear
-
Clear the current flow table of the controller.
Controller: | The controller which should execute the flow modification. |
Returns: | F on error or if the plugin does not support the operation, T when the operation was queued. |
-
OpenFlow::flow_mod
-
Global flow_mod function.
Controller: | The controller which should execute the flow modification. |
Match: | The ofp_match record which describes the flow to match. |
Flow_mod: | The openflow flow_mod record which describes the action to take. |
Returns: | F on error or if the plugin does not support the operation, T when the operation was queued. |
-
OpenFlow::generate_cookie
-
Function to generate a new cookie using our group id.
Cookie: | The openflow match cookie. |
Returns: | The cookie group id. |
-
OpenFlow::get_cookie_gid
-
Function to get the group id out of a given cookie.
Cookie: | The openflow match cookie. |
Returns: | The cookie group id. |
-
OpenFlow::get_cookie_uid
-
Function to get the unique id out of a given cookie.
Cookie: | The openflow match cookie. |
Returns: | The cookie unique id. |
-
OpenFlow::lookup_controller
-
Function to lookup a controller instance by name.
Name: | Unique name of the controller to look up. |
Returns: | One element vector with controller, if found. Empty vector otherwise. |
-
OpenFlow::match_conn
-
Convert a conn_id record into an ofp_match record that can be used to
create match objects for OpenFlow.
Id: | The conn_id record that describes the record. |
Reverse: | Reverse the sources and destinations when creating the match record (default F). |
Returns: | ofp_match object for the conn_id record. |
-
OpenFlow::register_controller
-
Function to register a controller instance. This function
is called automatically by the plugin _new functions.
Tpe: | Type of this plugin. |
Name: | Unique name of this controller instance. |
Controller: | The controller to register. |
-
OpenFlow::unregister_controller
-
Function to unregister a controller instance. This function
should be called when a specific controller should no longer
be used.
Controller: | The controller to unregister. |