diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2012-01-19 19:11:42 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-01-24 11:54:55 +0900 |
commit | 9cc4f69d720995b569b7cea9566983c8e51038e3 (patch) | |
tree | a36b0c5176ac4962e23cfaadc2f5c9c2bd7adb12 | |
parent | 91eb8983f1119629d78bf9373ac9213845b0df43 (diff) |
pep8: ryu/ofproto/ofproto_v1_0.py
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_0.py | 306 |
1 files changed, 154 insertions, 152 deletions
diff --git a/ryu/ofproto/ofproto_v1_0.py b/ryu/ofproto/ofproto_v1_0.py index 9ac3b957..cdd8603d 100644 --- a/ryu/ofproto/ofproto_v1_0.py +++ b/ryu/ofproto/ofproto_v1_0.py @@ -27,44 +27,44 @@ OFP_ETH_ALEN_STR = str(OFP_ETH_ALEN) # enum ofp_port OFPP_MAX = 0xff00 -OFPP_IN_PORT = 0xfff8 # Send the packet out the input port. This +OFPP_IN_PORT = 0xfff8 # Send the packet out the input port. This # virtual port must be explicitly used # in order to send back out of the input # port. -OFPP_TABLE = 0xfff9 # Perform actions in flow table. +OFPP_TABLE = 0xfff9 # Perform actions in flow table. # NB: This can only be the destination # port for packet-out messages. -OFPP_NORMAL = 0xfffa # Process with normal L2/L3 switching. -OFPP_FLOOD = 0xfffb # All physical ports except input port and +OFPP_NORMAL = 0xfffa # Process with normal L2/L3 switching. +OFPP_FLOOD = 0xfffb # All physical ports except input port and # those disabled by STP. -OFPP_ALL = 0xfffc # All physical ports except input port. -OFPP_CONTROLLER = 0xfffd # Send to controller. -OFPP_LOCAL = 0xfffe # Local openflow "port". -OFPP_NONE = 0xffff # Not associated with a physical port. +OFPP_ALL = 0xfffc # All physical ports except input port. +OFPP_CONTROLLER = 0xfffd # Send to controller. +OFPP_LOCAL = 0xfffe # Local openflow "port". +OFPP_NONE = 0xffff # Not associated with a physical port. # enum ofp_type -OFPT_HELLO = 0 # Symmetric message -OFPT_ERROR = 1 # Symmetric message -OFPT_ECHO_REQUEST = 2 # Symmetric message -OFPT_ECHO_REPLY = 3 # Symmetric message -OFPT_VENDOR = 4 # Symmetric message -OFPT_FEATURES_REQUEST = 5 # Controller/switch message -OFPT_FEATURES_REPLY = 6 # Controller/switch message -OFPT_GET_CONFIG_REQUEST = 7 # Controller/switch message -OFPT_GET_CONFIG_REPLY = 8 # Controller/switch message -OFPT_SET_CONFIG = 9 # Controller/switch message -OFPT_PACKET_IN = 10 # Async message -OFPT_FLOW_REMOVED = 11 # Async message -OFPT_PORT_STATUS = 12 # Async message -OFPT_PACKET_OUT = 13 # Controller/switch message -OFPT_FLOW_MOD = 14 # Controller/switch message -OFPT_PORT_MOD = 15 # Controller/switch message -OFPT_STATS_REQUEST = 16 # Controller/switch message -OFPT_STATS_REPLY = 17 # Controller/switch message -OFPT_BARRIER_REQUEST = 18 # Controller/switch message -OFPT_BARRIER_REPLY = 19 # Controller/switch message -OFPT_QUEUE_GET_CONFIG_REQUEST = 20 # Controller/switch message -OFPT_QUEUE_GET_CONFIG_REPLY = 21 # Controller/switch message +OFPT_HELLO = 0 # Symmetric message +OFPT_ERROR = 1 # Symmetric message +OFPT_ECHO_REQUEST = 2 # Symmetric message +OFPT_ECHO_REPLY = 3 # Symmetric message +OFPT_VENDOR = 4 # Symmetric message +OFPT_FEATURES_REQUEST = 5 # Controller/switch message +OFPT_FEATURES_REPLY = 6 # Controller/switch message +OFPT_GET_CONFIG_REQUEST = 7 # Controller/switch message +OFPT_GET_CONFIG_REPLY = 8 # Controller/switch message +OFPT_SET_CONFIG = 9 # Controller/switch message +OFPT_PACKET_IN = 10 # Async message +OFPT_FLOW_REMOVED = 11 # Async message +OFPT_PORT_STATUS = 12 # Async message +OFPT_PACKET_OUT = 13 # Controller/switch message +OFPT_FLOW_MOD = 14 # Controller/switch message +OFPT_PORT_MOD = 15 # Controller/switch message +OFPT_STATS_REQUEST = 16 # Controller/switch message +OFPT_STATS_REPLY = 17 # Controller/switch message +OFPT_BARRIER_REQUEST = 18 # Controller/switch message +OFPT_BARRIER_REPLY = 19 # Controller/switch message +OFPT_QUEUE_GET_CONFIG_REQUEST = 20 # Controller/switch message +OFPT_QUEUE_GET_CONFIG_REPLY = 21 # Controller/switch message OFP_HEADER_PACK_STR = '!BBHI' OFP_HEADER_SIZE = 8 @@ -75,10 +75,10 @@ assert calcsize(OFP_HEADER_PACK_STR) == OFP_HEADER_SIZE OFP_DEFAULT_MISS_SEND_LEN = 128 # enum ofp_config_flags -OFPC_FRAG_NORMAL = 0 # No special handling for fragments. -OFPC_FRAG_DROP = 1 # Drop fragments. -OFPC_FRAG_REASM = 2 # Reassemble (only if OFPC_IP_REASM set). -OFPC_FRAG_NX_MATCH = 3 # Make first fragments available for matching. +OFPC_FRAG_NORMAL = 0 # No special handling for fragments. +OFPC_FRAG_DROP = 1 # Drop fragments. +OFPC_FRAG_REASM = 2 # Reassemble (only if OFPC_IP_REASM set). +OFPC_FRAG_NX_MATCH = 3 # Make first fragments available for matching. OFPC_FRAG_MASK = 3 OFP_SWITCH_CONFIG_PACK_STR = '!HH' @@ -87,50 +87,51 @@ assert (calcsize(OFP_SWITCH_CONFIG_PACK_STR) + OFP_HEADER_SIZE == OFP_SWITCH_CONFIG_SIZE) # enum ofp_capabilities -OFPC_FLOW_STATS = 1 << 0 # Flow statistics. -OFPC_TABLE_STATS = 1 << 1 # Table statistics. -OFPC_PORT_STATS = 1 << 2 # Port statistics. -OFPC_STP = 1 << 3 # 802.1d spanning tree. -OFPC_RESERVED = 1 << 4 # Reserved, must not be set. -OFPC_IP_REASM = 1 << 5 # Can reassemble IP fragments. -OFPC_QUEUE_STATS = 1 << 6 # Queue statistics. -OFPC_ARP_MATCH_IP = 1 << 7 # Match IP addresses in ARP pkts. +OFPC_FLOW_STATS = 1 << 0 # Flow statistics. +OFPC_TABLE_STATS = 1 << 1 # Table statistics. +OFPC_PORT_STATS = 1 << 2 # Port statistics. +OFPC_STP = 1 << 3 # 802.1d spanning tree. +OFPC_RESERVED = 1 << 4 # Reserved, must not be set. +OFPC_IP_REASM = 1 << 5 # Can reassemble IP fragments. +OFPC_QUEUE_STATS = 1 << 6 # Queue statistics. +OFPC_ARP_MATCH_IP = 1 << 7 # Match IP addresses in ARP pkts. # enum ofp_port_config -OFPPC_PORT_DOWN = 1 << 0 # Port is administratively down. -OFPPC_NO_STP = 1 << 1 # Disable 802.1D spanning tree on port. -OFPPC_NO_RECV = 1 << 2 # Drop all packets except 802.1D - # spanning tree packets -OFPPC_NO_RECV_STP = 1 << 3 # Drop received 802.1D STP packets. -OFPPC_NO_FLOOD = 1 << 4 # Do not include this port when flooding. -OFPPC_NO_FWD = 1 << 5 # Drop packets forwarded to port. -OFPPC_NO_PACKET_IN = 1 << 6 # Do not send packet-in msgs for port. +OFPPC_PORT_DOWN = 1 << 0 # Port is administratively down. +OFPPC_NO_STP = 1 << 1 # Disable 802.1D spanning tree on port. +OFPPC_NO_RECV = 1 << 2 # Drop all packets except 802.1D + # spanning tree packets +OFPPC_NO_RECV_STP = 1 << 3 # Drop received 802.1D STP packets. +OFPPC_NO_FLOOD = 1 << 4 # Do not include this port when flooding. +OFPPC_NO_FWD = 1 << 5 # Drop packets forwarded to port. +OFPPC_NO_PACKET_IN = 1 << 6 # Do not send packet-in msgs for port. # enum ofp_port_state -OFPPS_LINK_DOWN = 1 << 0 # No physical link present. -OFPPS_STP_LISTEN = 0 << 8 # Not learning or relaying frames. -OFPPS_STP_LEARN = 1 << 8 # Learning but not relaying frames. -OFPPS_STP_FORWARD = 2 << 8 # Learning and relaying frames. -OFPPS_STP_BLOCK = 3 << 8 # Not part of spanning tree. -OFPPS_STP_MASK = 3 << 8 # Bit mask for OFPPS_STP_* values. +OFPPS_LINK_DOWN = 1 << 0 # No physical link present. +OFPPS_STP_LISTEN = 0 << 8 # Not learning or relaying frames. +OFPPS_STP_LEARN = 1 << 8 # Learning but not relaying frames. +OFPPS_STP_FORWARD = 2 << 8 # Learning and relaying frames. +OFPPS_STP_BLOCK = 3 << 8 # Not part of spanning tree. +OFPPS_STP_MASK = 3 << 8 # Bit mask for OFPPS_STP_* values. # enum ofp_port_features -OFPPF_10MB_HD = 1 << 0 # 10 Mb half-duplex rate support. -OFPPF_10MB_FD = 1 << 1 # 10 Mb full-duplex rate support. -OFPPF_100MB_HD = 1 << 2 # 100 Mb half-duplex rate support. -OFPPF_100MB_FD = 1 << 3 # 100 Mb full-duplex rate support. -OFPPF_1GB_HD = 1 << 4 # 1 Gb half-duplex rate support. -OFPPF_1GB_FD = 1 << 5 # 1 Gb full-duplex rate support. -OFPPF_10GB_FD = 1 << 6 # 10 Gb full-duplex rate support. -OFPPF_COPPER = 1 << 7 # Copper medium. -OFPPF_FIBER = 1 << 8 # Fiber medium. -OFPPF_AUTONEG = 1 << 9 # Auto-negotiation. -OFPPF_PAUSE = 1 << 10 # Pause. -OFPPF_PAUSE_ASYM = 1 << 11 # Asymmetric pause. - -_OFP_PHY_PORT_PACK_STR = 'H' + OFP_ETH_ALEN_STR + 's' + str(OFP_MAX_PORT_NAME_LEN) + 'sIIIIII' +OFPPF_10MB_HD = 1 << 0 # 10 Mb half-duplex rate support. +OFPPF_10MB_FD = 1 << 1 # 10 Mb full-duplex rate support. +OFPPF_100MB_HD = 1 << 2 # 100 Mb half-duplex rate support. +OFPPF_100MB_FD = 1 << 3 # 100 Mb full-duplex rate support. +OFPPF_1GB_HD = 1 << 4 # 1 Gb half-duplex rate support. +OFPPF_1GB_FD = 1 << 5 # 1 Gb full-duplex rate support. +OFPPF_10GB_FD = 1 << 6 # 10 Gb full-duplex rate support. +OFPPF_COPPER = 1 << 7 # Copper medium. +OFPPF_FIBER = 1 << 8 # Fiber medium. +OFPPF_AUTONEG = 1 << 9 # Auto-negotiation. +OFPPF_PAUSE = 1 << 10 # Pause. +OFPPF_PAUSE_ASYM = 1 << 11 # Asymmetric pause. + +_OFP_PHY_PORT_PACK_STR = 'H' + OFP_ETH_ALEN_STR + 's' + \ + str(OFP_MAX_PORT_NAME_LEN) + 'sIIIIII' OFP_PHY_PORT_PACK_STR = '!' + _OFP_PHY_PORT_PACK_STR -OFP_PHY_PORT_SIZE = 48 +OFP_PHY_PORT_SIZE = 48 assert calcsize(OFP_PHY_PORT_PACK_STR) == OFP_PHY_PORT_SIZE OFP_SWITCH_FEATURES_PACK_STR = '!QIB3xII' @@ -139,9 +140,9 @@ assert (calcsize(OFP_SWITCH_FEATURES_PACK_STR) + OFP_HEADER_SIZE == OFP_SWITCH_FEATURES_SIZE) # enum ofp_port_reason -OFPPR_ADD = 0 # The port was added. -OFPPR_DELETE = 1 # The port was removed. -OFPPR_MODIFY = 2 # Some attribute of the port has changed. +OFPPR_ADD = 0 # The port was added. +OFPPR_DELETE = 1 # The port was removed. +OFPPR_MODIFY = 2 # Some attribute of the port has changed. OFP_PORT_STATUS_PACK_STR = '!B7x' + _OFP_PHY_PORT_PACK_STR OFP_PORT_STATUS_DESC_OFFSET = OFP_HEADER_SIZE + 8 @@ -154,27 +155,27 @@ OFP_PORT_MOD_SIZE = 32 assert calcsize(OFP_PORT_MOD_PACK_STR) + OFP_HEADER_SIZE == OFP_PORT_MOD_SIZE # enum ofp_packet_in_reason -OFPR_NO_MATCH = 0 # No matching flow. -OFPR_ACTION = 1 # Action explicitly output to controller. +OFPR_NO_MATCH = 0 # No matching flow. +OFPR_ACTION = 1 # Action explicitly output to controller. -OFP_PACKET_IN_PACK_STR = '!IHHBx2x' # the last 2x is for ofp_packet_in::data +OFP_PACKET_IN_PACK_STR = '!IHHBx2x' # the last 2x is for ofp_packet_in::data OFP_PACKET_IN_SIZE = 20 OFP_PACKET_IN_DATA_OFFSET = 18 assert calcsize(OFP_PACKET_IN_PACK_STR) + OFP_HEADER_SIZE == OFP_PACKET_IN_SIZE # enum ofp_action_type -OFPAT_OUTPUT = 0 # Output to switch port. -OFPAT_SET_VLAN_VID = 1 # Set the 802.1q VLAN id. -OFPAT_SET_VLAN_PCP = 2 # Set the 802.1q priority. -OFPAT_STRIP_VLAN = 3 # Strip the 802.1q header. -OFPAT_SET_DL_SRC = 4 # Ethernet source address. -OFPAT_SET_DL_DST = 5 # Ethernet destination address. -OFPAT_SET_NW_SRC = 6 # IP source address. -OFPAT_SET_NW_DST = 7 # IP destination address. -OFPAT_SET_NW_TOS = 8 # IP ToS (DSCP field, 6 bits). -OFPAT_SET_TP_SRC = 9 # TCP/UDP source port. -OFPAT_SET_TP_DST = 10 # TCP/UDP destination port. -OFPAT_ENQUEUE = 11 # Output to queue. +OFPAT_OUTPUT = 0 # Output to switch port. +OFPAT_SET_VLAN_VID = 1 # Set the 802.1q VLAN id. +OFPAT_SET_VLAN_PCP = 2 # Set the 802.1q priority. +OFPAT_STRIP_VLAN = 3 # Strip the 802.1q header. +OFPAT_SET_DL_SRC = 4 # Ethernet source address. +OFPAT_SET_DL_DST = 5 # Ethernet destination address. +OFPAT_SET_NW_SRC = 6 # IP source address. +OFPAT_SET_NW_DST = 7 # IP destination address. +OFPAT_SET_NW_TOS = 8 # IP ToS (DSCP field, 6 bits). +OFPAT_SET_TP_SRC = 9 # TCP/UDP source port. +OFPAT_SET_TP_DST = 10 # TCP/UDP destination port. +OFPAT_ENQUEUE = 11 # Output to queue. OFPAT_VENDOR = 0xffff OFP_ACTION_OUTPUT_PACK_STR = '!HHHH' @@ -233,21 +234,21 @@ assert (calcsize(OFP_PACKET_OUT_PACK_STR) + OFP_HEADER_SIZE == OFP_PACKET_OUT_SIZE) # enum ofp_flow_mod_command -OFPFC_ADD = 0 # New flow. -OFPFC_MODIFY = 1 # Modify all matching flows. -OFPFC_MODIFY_STRICT = 2 # Modify entry strictly matching wildcards -OFPFC_DELETE = 3 # Delete all matching flows. -OFPFC_DELETE_STRICT = 4 # Strictly match wildcards and priority. +OFPFC_ADD = 0 # New flow. +OFPFC_MODIFY = 1 # Modify all matching flows. +OFPFC_MODIFY_STRICT = 2 # Modify entry strictly matching wildcards +OFPFC_DELETE = 3 # Delete all matching flows. +OFPFC_DELETE_STRICT = 4 # Strictly match wildcards and priority. # enum ofp_flow_wildcards -OFPFW_IN_PORT = 1 << 0 # Switch input port. -OFPFW_DL_VLAN = 1 << 1 # VLAN vid. -OFPFW_DL_SRC = 1 << 2 # Ethernet source address. -OFPFW_DL_DST = 1 << 3 # Ethernet destination address. -OFPFW_DL_TYPE = 1 << 4 # Ethernet frame type. -OFPFW_NW_PROTO = 1 << 5 # IP protocol. -OFPFW_TP_SRC = 1 << 6 # TCP/UDP source port. -OFPFW_TP_DST = 1 << 7 # TCP/UDP destination port. +OFPFW_IN_PORT = 1 << 0 # Switch input port. +OFPFW_DL_VLAN = 1 << 1 # VLAN vid. +OFPFW_DL_SRC = 1 << 2 # Ethernet source address. +OFPFW_DL_DST = 1 << 3 # Ethernet destination address. +OFPFW_DL_TYPE = 1 << 4 # Ethernet frame type. +OFPFW_NW_PROTO = 1 << 5 # IP protocol. +OFPFW_TP_SRC = 1 << 6 # TCP/UDP source port. +OFPFW_TP_DST = 1 << 7 # TCP/UDP destination port. OFPFW_NW_SRC_SHIFT = 8 OFPFW_NW_SRC_BITS = 6 OFPFW_NW_SRC_MASK = ((1 << OFPFW_NW_SRC_BITS) - 1) << OFPFW_NW_SRC_SHIFT @@ -256,8 +257,8 @@ OFPFW_NW_DST_SHIFT = 14 OFPFW_NW_DST_BITS = 6 OFPFW_NW_DST_MASK = ((1 << OFPFW_NW_DST_BITS) - 1) << OFPFW_NW_DST_SHIFT OFPFW_NW_DST_ALL = 32 << OFPFW_NW_DST_SHIFT -OFPFW_DL_VLAN_PCP = 1 << 20 # VLAN priority. -OFPFW_NW_TOS = 1 << 21 # IP ToS (DSCP field, 6 bits). +OFPFW_DL_VLAN_PCP = 1 << 20 # VLAN priority. +OFPFW_NW_TOS = 1 << 21 # IP ToS (DSCP field, 6 bits). OFPFW_ALL = ((1 << 22) - 1) # define constants @@ -267,7 +268,8 @@ OFP_DL_TYPE_ETH2_CUTOFF = 0x0600 OFP_DL_TYPE_NOT_ETH_TYPE = 0x05ff OFP_VLAN_NONE = 0xffff -_OFP_MATCH_PACK_STR = 'IH' + OFP_ETH_ALEN_STR + 's' + OFP_ETH_ALEN_STR + 'sHBxHBB2xIIHH' +_OFP_MATCH_PACK_STR = 'IH' + OFP_ETH_ALEN_STR + 's' + OFP_ETH_ALEN_STR + \ + 'sHBxHBB2xIIHH' OFP_MATCH_PACK_STR = '!' + _OFP_MATCH_PACK_STR OFP_MATCH_SIZE = 40 assert calcsize(OFP_MATCH_PACK_STR) == OFP_MATCH_SIZE @@ -276,10 +278,10 @@ OFP_FLOW_PERMANENT = 0 OFP_DEFAULT_PRIORITY = 0x8000 # enum ofp_flow_mod_flags -OFPFF_SEND_FLOW_REM = 1 << 0 # Send flow removed message when flow +OFPFF_SEND_FLOW_REM = 1 << 0 # Send flow removed message when flow # expires or is deleted. -OFPFF_CHECK_OVERLAP = 1 << 1 # Check for overlapping entries first. -OFPFF_EMERG = 1 << 2 # Ramark this is for emergency. +OFPFF_CHECK_OVERLAP = 1 << 1 # Check for overlapping entries first. +OFPFF_EMERG = 1 << 2 # Ramark this is for emergency. _OFP_FLOW_MOD_PACK_STR0 = 'QHHHHIHH' OFP_FLOW_MOD_PACK_STR = '!' + _OFP_MATCH_PACK_STR + _OFP_FLOW_MOD_PACK_STR0 @@ -288,9 +290,9 @@ OFP_FLOW_MOD_SIZE = 72 assert calcsize(OFP_FLOW_MOD_PACK_STR) + OFP_HEADER_SIZE == OFP_FLOW_MOD_SIZE # enum ofp_flow_removed_reason -OFPRR_IDLE_TIMEOUT = 0 # Flow idle time exceeded idle_timeout. -OFPRR_HARD_TIMEOUT = 1 # Time exceeded hard_timeout. -OFPRR_DELETE = 2 # Evicted by a DELETE flow mod. +OFPRR_IDLE_TIMEOUT = 0 # Flow idle time exceeded idle_timeout. +OFPRR_HARD_TIMEOUT = 1 # Time exceeded hard_timeout. +OFPRR_DELETE = 2 # Evicted by a DELETE flow mod. _OFP_FLOW_REMOVED_PACK_STR0 = 'QHBxIIH2xQQ' OFP_FLOW_REMOVED_PACK_STR = '!' + _OFP_MATCH_PACK_STR + \ @@ -302,59 +304,59 @@ assert (calcsize(OFP_FLOW_REMOVED_PACK_STR) + OFP_HEADER_SIZE == # enum ofp_error_type -OFPET_HELLO_FAILED = 0 # Hello protocol failed. -OFPET_BAD_REQUEST = 1 # Request was not understood. -OFPET_BAD_ACTION = 2 # Error in action description. -OFPET_FLOW_MOD_FAILED = 3 # Problem modifying flow entry. -OFPET_PORT_MOD_FAILED = 4 # OFPT_PORT_MOD failed. -OFPET_QUEUE_OP_FAILED = 5 # Queue operation failed. +OFPET_HELLO_FAILED = 0 # Hello protocol failed. +OFPET_BAD_REQUEST = 1 # Request was not understood. +OFPET_BAD_ACTION = 2 # Error in action description. +OFPET_FLOW_MOD_FAILED = 3 # Problem modifying flow entry. +OFPET_PORT_MOD_FAILED = 4 # OFPT_PORT_MOD failed. +OFPET_QUEUE_OP_FAILED = 5 # Queue operation failed. # enum ofp_hello_failed_code -OFPHFC_INCOMPATIBLE = 0 # No compatible version. -OFPHFC_EPERM = 1 # Permissions error. +OFPHFC_INCOMPATIBLE = 0 # No compatible version. +OFPHFC_EPERM = 1 # Permissions error. # enum ofp_bad_request_code -OFPBRC_BAD_VERSION = 0 # ofp_header.version not supported. -OFPBRC_BAD_TYPE = 1 # ofp_header.type not supported. -OFPBRC_BAD_STAT = 2 # ofp_stats_msg.type not supported. -OFPBRC_BAD_VENDOR = 3 # Vendor not supported (in ofp_vendor_header - # or ofp_stats_msg). -OFPBRC_BAD_SUBTYPE = 4 # Vendor subtype not supported. -OFPBRC_EPERM = 5 # Permissions error. -OFPBRC_BAD_LEN = 6 # Wrong request length for type. -OFPBRC_BUFFER_EMPTY = 7 # Specified buffer has already been used. -OFPBRC_BUFFER_UNKNOWN = 8 # Specified buffer does not exist. +OFPBRC_BAD_VERSION = 0 # ofp_header.version not supported. +OFPBRC_BAD_TYPE = 1 # ofp_header.type not supported. +OFPBRC_BAD_STAT = 2 # ofp_stats_msg.type not supported. +OFPBRC_BAD_VENDOR = 3 # Vendor not supported (in ofp_vendor_header + # or ofp_stats_msg). +OFPBRC_BAD_SUBTYPE = 4 # Vendor subtype not supported. +OFPBRC_EPERM = 5 # Permissions error. +OFPBRC_BAD_LEN = 6 # Wrong request length for type. +OFPBRC_BUFFER_EMPTY = 7 # Specified buffer has already been used. +OFPBRC_BUFFER_UNKNOWN = 8 # Specified buffer does not exist. # enum ofp_bad_action_code -OFPBAC_BAD_TYPE = 0 # Unknown action type. -OFPBAC_BAD_LEN = 1 # Length problem in actions. -OFPBAC_BAD_VENDOR = 2 # Unknown vendor id specified. -OFPBAC_BAD_VENDOR_TYPE = 3 # Unknown action type for vendor id. -OFPBAC_BAD_OUT_PORT = 4 # Problem validating output action. -OFPBAC_BAD_ARGUMENT = 5 # Bad action argument. -OFPBAC_EPERM = 6 # Permissions error. -OFPBAC_TOO_MANY = 7 # Can't handle this many actions. -OFPBAC_BAD_QUEUE = 8 # Problem validating output queue. +OFPBAC_BAD_TYPE = 0 # Unknown action type. +OFPBAC_BAD_LEN = 1 # Length problem in actions. +OFPBAC_BAD_VENDOR = 2 # Unknown vendor id specified. +OFPBAC_BAD_VENDOR_TYPE = 3 # Unknown action type for vendor id. +OFPBAC_BAD_OUT_PORT = 4 # Problem validating output action. +OFPBAC_BAD_ARGUMENT = 5 # Bad action argument. +OFPBAC_EPERM = 6 # Permissions error. +OFPBAC_TOO_MANY = 7 # Can't handle this many actions. +OFPBAC_BAD_QUEUE = 8 # Problem validating output queue. # enum ofp_flow_mod_failed_code -OFPFMFC_ALL_TABLES_FULL = 0 # Flow not added because of full tables. -OFPFMFC_OVERLAP = 1 # Attempted to add overlapping flow with - # CHECK_OVERLAP flags set. -OFPFMFC_EPERM = 2 # Permissions error. -OFPFMFC_BAD_EMERG_TIMEOUT = 3 # Flow not added because of non-zero idle/hard +OFPFMFC_ALL_TABLES_FULL = 0 # Flow not added because of full tables. +OFPFMFC_OVERLAP = 1 # Attempted to add overlapping flow with + # CHECK_OVERLAP flags set. +OFPFMFC_EPERM = 2 # Permissions error. +OFPFMFC_BAD_EMERG_TIMEOUT = 3 # Flow not added because of non-zero idle/hard # timeout. -OFPFMFC_BAD_COMMAND = 4 # Unknown command. -OFPFMFC_UNSUPPORTED = 5 # Unsupported action list - cannot process in - # the order specified. +OFPFMFC_BAD_COMMAND = 4 # Unknown command. +OFPFMFC_UNSUPPORTED = 5 # Unsupported action list - cannot process in + # the order specified. # enum ofp_port_mod_failed_code -OFPPMFC_BAD_PORT = 0 # Specified port does not exist. -OFPPMFC_BAD_HW_ADDR = 1 # Specified hardware address is wrong. +OFPPMFC_BAD_PORT = 0 # Specified port does not exist. +OFPPMFC_BAD_HW_ADDR = 1 # Specified hardware address is wrong. # enum ofp_queue_op_failed_code -OFPQOFC_BAD_PORT = 0 # Invalid port (or port does not exist). -OFPQOFC_BAD_QUEUE = 1 # Queue does not exist. -OFPQOFC_EPERM = 2 # Permissions error. +OFPQOFC_BAD_PORT = 0 # Invalid port (or port does not exist). +OFPQOFC_BAD_QUEUE = 1 # Queue does not exist. +OFPQOFC_EPERM = 2 # Permissions error. OFP_ERROR_MSG_PACK_STR = '!HH' OFP_ERROR_MSG_SIZE = 12 @@ -375,7 +377,7 @@ OFP_STATS_MSG_SIZE = 12 assert calcsize(OFP_STATS_MSG_PACK_STR) + OFP_HEADER_SIZE == OFP_STATS_MSG_SIZE # enum ofp_stats_reply_flags -OFPSF_REPLY_MORE = 1 << 0 # More replies to follow. +OFPSF_REPLY_MORE = 1 << 0 # More replies to follow. # define constants DESC_STR_LEN = 256 |