base/frameworks/openflow/types.zeek

OpenFlow

Types used by the OpenFlow framework.

Namespace

OpenFlow

Imports

base/frameworks/openflow/consts.zeek

Summary

Types

OpenFlow::Controller: record

Controller record representing an openflow controller.

OpenFlow::ControllerState: record &redef

Controller related state.

OpenFlow::Plugin: enum

Available openflow plugins.

OpenFlow::ofp_flow_action: record &log

The actions that can be taken in a flow.

OpenFlow::ofp_flow_mod: record &log

Openflow flow_mod definition, describing the action to perform.

OpenFlow::ofp_match: record &log

Openflow match definition.

Detailed Interface

Types

OpenFlow::Controller
Type

record

state: OpenFlow::ControllerState

Controller related state.

supports_flow_removed: bool

Does the controller support the flow_removed event?

describe: function (state: OpenFlow::ControllerState)string

Function that describes the controller. Has to be implemented.

init: function (state: OpenFlow::ControllerState)void &optional

One-time initialization function. If defined, controller_init_done has to be called once initialization finishes.

destroy: function (state: OpenFlow::ControllerState)void &optional

One-time destruction function.

flow_mod: function (state: OpenFlow::ControllerState, match: OpenFlow::ofp_match, flow_mod: OpenFlow::ofp_flow_mod)bool &optional

flow_mod function.

flow_clear: function (state: OpenFlow::ControllerState)bool &optional

flow_clear function.

Controller record representing an openflow controller.

OpenFlow::ControllerState
Type

record

_plugin: OpenFlow::Plugin &optional

Internally set to the type of plugin used.

_name: string &optional

Internally set to the unique name of the controller.

_activated: bool &default = F &optional

Internally set to true once the controller is activated.

ryu_host: addr &optional

(present if base/frameworks/openflow/plugins/ryu.zeek is loaded)

Controller ip.

ryu_port: count &optional

(present if base/frameworks/openflow/plugins/ryu.zeek is loaded)

Controller listen port.

ryu_dpid: count &optional

(present if base/frameworks/openflow/plugins/ryu.zeek is loaded)

OpenFlow switch datapath id.

ryu_debug: bool &default = F &optional

(present if base/frameworks/openflow/plugins/ryu.zeek is loaded)

Enable debug mode - output JSON to stdout; do not perform actions.

log_dpid: count &optional

(present if base/frameworks/openflow/plugins/log.zeek is loaded)

OpenFlow switch datapath id.

log_success_event: bool &optional

(present if base/frameworks/openflow/plugins/log.zeek is loaded)

Raise or do not raise success event.

broker_host: addr &optional

(present if base/frameworks/openflow/plugins/broker.zeek is loaded)

Controller ip.

broker_port: port &optional

(present if base/frameworks/openflow/plugins/broker.zeek is loaded)

Controller listen port.

broker_dpid: count &optional

(present if base/frameworks/openflow/plugins/broker.zeek is loaded)

OpenFlow switch datapath id.

broker_topic: string &optional

(present if base/frameworks/openflow/plugins/broker.zeek is loaded)

Topic to send events for this controller to.

Attributes

&redef

Controller related state. Can be redefined by plugins to add state.

OpenFlow::Plugin
Type

enum

OpenFlow::INVALID

Internal placeholder plugin.

OpenFlow::RYU

(present if base/frameworks/openflow/plugins/ryu.zeek is loaded)

OpenFlow::OFLOG

(present if base/frameworks/openflow/plugins/log.zeek is loaded)

OpenFlow::BROKER

(present if base/frameworks/openflow/plugins/broker.zeek is loaded)

Available openflow plugins.

OpenFlow::ofp_flow_action
Type

record

out_ports: vector of count &default = [] &optional &log

Output ports to send data to.

vlan_vid: count &optional &log

Set vlan vid to this value.

vlan_pcp: count &optional &log

Set vlan priority to this value.

vlan_strip: bool &default = F &optional &log

Strip vlan tag.

dl_src: string &optional &log

Set ethernet source address.

dl_dst: string &optional &log

Set ethernet destination address.

nw_tos: count &optional &log

Set ip tos to this value.

nw_src: addr &optional &log

Set source to this ip.

nw_dst: addr &optional &log

Set destination to this ip.

tp_src: count &optional &log

Set tcp/udp source port.

tp_dst: count &optional &log

Set tcp/udp destination port.

Attributes

&log

The actions that can be taken in a flow. (Separate record to make ofp_flow_mod less crowded)

OpenFlow::ofp_flow_mod
Type

record

cookie: count &log

Opaque controller-issued identifier.

table_id: count &optional &log

Table to put the flow in. OFPTT_ALL can be used for delete, to delete flows from all matching tables.

command: OpenFlow::ofp_flow_mod_command &log

One of OFPFC_*.

idle_timeout: count &default = 0 &optional &log

Idle time before discarding (seconds).

hard_timeout: count &default = 0 &optional &log

Max time before discarding (seconds).

priority: count &default = 0 &optional &log

Priority level of flow entry.

out_port: count &optional &log

For OFPFC_DELETE* commands, require matching entry to include this as an output port/group. OFPP_ANY/OFPG_ANY means no restrictions.

out_group: count &optional &log

flags: count &default = 0 &optional &log

Bitmap of the OFPFF_* flags

actions: OpenFlow::ofp_flow_action &default = [out_ports=[], vlan_vid=<uninitialized>, vlan_pcp=<uninitialized>, vlan_strip=F, dl_src=<uninitialized>, dl_dst=<uninitialized>, nw_tos=<uninitialized>, nw_src=<uninitialized>, nw_dst=<uninitialized>, tp_src=<uninitialized>, tp_dst=<uninitialized>] &optional &log

Actions to take on match

Attributes

&log

Openflow flow_mod definition, describing the action to perform.

OpenFlow::ofp_match
Type

record

in_port: count &optional &log

dl_src: string &optional &log

dl_dst: string &optional &log

dl_vlan: count &optional &log

dl_vlan_pcp: count &optional &log

dl_type: count &optional &log

nw_tos: count &optional &log

nw_proto: count &optional &log

nw_src: subnet &optional &log

nw_dst: subnet &optional &log

tp_src: count &optional &log

tp_dst: count &optional &log

Attributes

&log

Openflow match definition.

The openflow match record describes which packets match to a specific rule in a flow table.