diff --git a/java_gen/java_type.py b/java_gen/java_type.py index 49f00340f..0edefcf27 100644 --- a/java_gen/java_type.py +++ b/java_gen/java_type.py @@ -326,6 +326,9 @@ def gen_fixed_length_string_jtype(length): # the same OFPort, but with a default value of ZERO, only for OF10 match of_port_match_v1 = JType("OFPort") \ .op(version=1, read="OFPort.read2Bytes(bb)", write="$name.write2Bytes(bb)", default="OFPort.ZERO") +# the same as OFPort, but always 2-bytes and defaults to IN_PORT +of_port_nicira = JType("OFPort") \ + .op(version=ANY, read="OFPort.read2Bytes(bb)", write="$name.write2Bytes(bb)", default="OFPort.IN_PORT") actions_list = gen_list_jtype("OFAction") instructions_list = gen_list_jtype("OFInstruction") buckets_list = gen_list_jtype("OFBucket") @@ -813,6 +816,9 @@ def gen_fixed_length_string_jtype(length): 'of_bsn_gentable_entry_add' : { 'table_id' : gen_table_id }, 'of_bsn_log': { 'data': var_string }, + 'of_action_nicira_resubmit': { 'port': of_port_nicira }, + 'of_action_nicira_resubmit_table': { 'port': of_port_nicira }, + 'of_features_reply' : { 'auxiliary_id' : of_aux_id}, 'of_bundle_add_msg' : { 'data' : of_message }, diff --git a/openflow_input/nicira_exit b/openflow_input/nicira_exit new file mode 100644 index 000000000..625a34669 --- /dev/null +++ b/openflow_input/nicira_exit @@ -0,0 +1,16 @@ +#version any + +// Nicira (OpenVSwitch) Exit action. +// +// Causes the datapath to immediately halt execution of further apply-actions. +// +// See ovs-ofctl man page for details: +// http://openvswitch.org/support/dist-docs/ovs-ofctl.8.txt +struct of_action_nicira_exit : of_action_nicira { + uint16_t type == 65535; + uint16_t len; + uint32_t experimenter == 0x2320; + uint16_t subtype == 0x11; + pad(2); + pad(4); +}; diff --git a/openflow_input/nicira_resubmit b/openflow_input/nicira_resubmit new file mode 100644 index 000000000..edff425e5 --- /dev/null +++ b/openflow_input/nicira_resubmit @@ -0,0 +1,19 @@ +#version any + +// Nicira (OpenVSwitch) Resubmit action. +// +// Re-searches this OpenFlow flow table with the in_port field +// replaced by port (if port is not OFPP_IN_PORT) and executes the +// actions found, if any, in addition to any other actions in this +// flow entry. +// +// See ovs-ofctl man page for details: +// http://openvswitch.org/support/dist-docs/ovs-ofctl.8.txt +struct of_action_nicira_resubmit : of_action_nicira { + uint16_t type == 65535; + uint16_t len; + uint32_t experimenter == 0x2320; + uint16_t subtype == 0x1; + uint16_t port; // 16-bit port number for all OF versions, default should be OFPP_IN_PORT + pad(4); +}; diff --git a/openflow_input/nicira_resubmit_table b/openflow_input/nicira_resubmit_table new file mode 100644 index 000000000..53ad0a190 --- /dev/null +++ b/openflow_input/nicira_resubmit_table @@ -0,0 +1,20 @@ +#version any + +// Nicira (OpenVSwitch) Resubmit action with table id. +// +// Searches the specified OpenFlow flow table with the in_port field +// replaced by port (if port is not OFPP_IN_PORT) and executes the +// actions found, if any, in addition to any other actions in this +// flow entry. +// +// See ovs-ofctl man page for details: +// http://openvswitch.org/support/dist-docs/ovs-ofctl.8.txt +struct of_action_nicira_resubmit_table : of_action_nicira { + uint16_t type == 65535; + uint16_t len; + uint32_t experimenter == 0x2320; + uint16_t subtype == 0xe; + uint16_t port; // 16-bit port number for all OF versions, default should be OFPP_IN_PORT + uint8_t table_id; // OFPTT_ALL means "same table as this flow" + pad(3); +};