const_values: add enum, entry parameters
Currently defined parameters:
enum:
- wire_type: type the values have on the wire (e.g., uint32_t)
- bitmask: boolean flag if const is an enumeration (False)[Default], or
a bitmask (True)
- complete: whether the values listed are a complete enumeration of
all possible values or not
entry:
- virtual: whether the entry is a virtual, i.e., doesn't define
a true enum value in its own right (true for _MASK_BIT values)
diff --git a/loxi_front_end/frontend.py b/loxi_front_end/frontend.py
index ab98c26..c12eaae 100644
--- a/loxi_front_end/frontend.py
+++ b/loxi_front_end/frontend.py
@@ -64,7 +64,14 @@
ofclass = OFClass(name=decl_ast[1], members=members)
ofinput.classes.append(ofclass)
if decl_ast[0] == 'enum':
- enum = OFEnum(name=decl_ast[1], values=[(x[0], x[1]) for x in decl_ast[2]])
+ # 0: "enum"
+ # 1: name
+ # 2: potentially list of [param_name, param_value]
+ # 3: list of [constant_name, constant_value]+
+ enum = OFEnum(name=decl_ast[1],
+ entries=[OFEnumEntry(name=x[0], value=x[2], params={param:value for param, value in x[1] }) for x in decl_ast[3]],
+ params = { param: value for param, value in decl_ast[2] }
+ )
ofinput.enums.append(enum)
elif decl_ast[0] == 'metadata':
if decl_ast[1] == 'version':
diff --git a/loxi_front_end/parser.py b/loxi_front_end/parser.py
index 503a05a..03d5af1 100644
--- a/loxi_front_end/parser.py
+++ b/loxi_front_end/parser.py
@@ -59,10 +59,20 @@
s('}') - s(';')
# Enums
-enum_member = P.Group(identifier + s('=') + integer)
+enum_param_name = kw("wire_type") | kw("bitmask") | kw("complete")
+enum_param = P.Group(enum_param_name - s('=') - any_type)
+enum_param_list = P.Forward()
+enum_param_list << enum_param + P.Optional(s(',') + P.Optional(enum_param_list))
+
+enum_member_param_name = kw("virtual")
+enum_member_param = P.Group(enum_member_param_name - s('=') - any_type)
+enum_member_param_list = P.Forward()
+enum_member_param_list << enum_member_param + P.Optional(s(',') + P.Optional(enum_member_param_list))
+
+enum_member = P.Group(identifier - P.Group(P.Optional(s('(') - enum_member_param_list - s(')'))) - s('=') + integer)
enum_list = P.Forward()
enum_list << enum_member + P.Optional(s(',') + P.Optional(enum_list))
-enum = kw('enum') - identifier - s('{') + \
+enum = kw('enum') - identifier - P.Group(P.Optional(s('(') - enum_param_list - s(')'))) - s('{') + \
P.Group(P.Optional(enum_list)) + \
s('}') - s(';')
diff --git a/loxi_ir.py b/loxi_ir.py
index 9a27272..8f1e822 100644
--- a/loxi_ir.py
+++ b/loxi_ir.py
@@ -39,6 +39,7 @@
'OFFieldLengthMember',
'OFPadMember',
'OFEnum',
+ 'OFEnumEntry'
]
"""
@@ -131,6 +132,13 @@
All values are Python ints.
@param name
-@param values List of (name, value) tuples in input order
+@param entries List of OFEnumEntry objects in input order
+@params dict of optional params. Currently defined:
+ - wire_type: the low_level type of the enum values (uint8,...)
"""
-OFEnum = namedtuple('OFEnum', ['name', 'values'])
+class OFEnum(namedtuple('OFEnum', ['name', 'entries', 'params'])):
+ @property
+ def values(self):
+ return [(e.name, e.value) for e in self.entries]
+
+OFEnumEntry = namedtuple('OFEnumEntry', ['name', 'value', 'params'])
diff --git a/loxigen.py b/loxigen.py
index 36d6872..92204ca 100755
--- a/loxigen.py
+++ b/loxigen.py
@@ -451,10 +451,10 @@
versions[version_name]['classes'][ofclass.name] = legacy_members
for enum in ofinput.enums:
- for name, value in enum.values:
+ for entry in enum.entries:
identifiers.add_identifier(
- translation.loxi_name(name),
- name, enum.name, value, wire_version,
+ translation.loxi_name(entry.name),
+ entry.name, enum.name, entry.value, wire_version,
of_g.identifiers, of_g.identifiers_by_group)
for wire_version, ofinputs in ofinputs_by_version.items():
diff --git a/openflow_input/bsn_vport b/openflow_input/bsn_vport
index 0cf30bf..03b4b43 100644
--- a/openflow_input/bsn_vport
+++ b/openflow_input/bsn_vport
@@ -38,7 +38,7 @@
// When the ingress or egress VID has this value, no outer tag should be used.
// In this case, the corresponding TPID is ignored.
-enum ofp_bsn_vport_q_in_q_untagged {
+enum ofp_bsn_vport_q_in_q_untagged(wire_type=uint16_t, complete=False) {
OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 0xffff,
};
diff --git a/openflow_input/standard-1.0 b/openflow_input/standard-1.0
index e9cb6f0..ceb2016 100644
--- a/openflow_input/standard-1.0
+++ b/openflow_input/standard-1.0
@@ -61,7 +61,7 @@
OFPQ_MIN_RATE_UNCFG = 0xffff,
};
-enum ofp_type {
+enum ofp_type(wire_type=uint8_t) {
OFPT_HELLO = 0,
OFPT_ERROR = 1,
OFPT_ECHO_REQUEST = 2,
@@ -86,7 +86,7 @@
OFPT_QUEUE_GET_CONFIG_REPLY = 21,
};
-enum ofp_port_config {
+enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
OFPPC_PORT_DOWN = 0x1,
OFPPC_NO_STP = 0x2,
OFPPC_NO_RECV = 0x4,
@@ -96,16 +96,19 @@
OFPPC_NO_PACKET_IN = 0x40,
};
-enum ofp_port_state {
+enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
OFPPS_STP_LISTEN = 0,
OFPPS_LINK_DOWN = 1,
OFPPS_STP_LEARN = 0x100,
OFPPS_STP_FORWARD = 0x200,
OFPPS_STP_BLOCK = 0x300,
- OFPPS_STP_MASK = 0x300,
+ OFPPS_STP_MASK(virtual=True) = 0x300,
};
-enum ofp_port {
+// FIXME: these constants are currently 32 bit due to implementation
+// details of loci, which is in violation of the OpenFlow spec.
+// Should recast to 32 bits and fix/glue the c backend
+enum ofp_port(wire_type=uint16_t, complete=False) {
OFPP_MAX = 0xffffff00,
OFPP_IN_PORT = 0xfffffff8,
OFPP_TABLE = 0xfffffff9,
@@ -117,7 +120,7 @@
OFPP_NONE = 0xffffffff,
};
-enum ofp_port_features {
+enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
OFPPF_10MB_HD = 0x1,
OFPPF_10MB_FD = 0x2,
OFPPF_100MB_HD = 0x4,
@@ -132,12 +135,12 @@
OFPPF_PAUSE_ASYM = 0x800,
};
-enum ofp_queue_properties {
+enum ofp_queue_properties(wire_type=uint32_t) {
OFPQT_NONE = 0,
OFPQT_MIN_RATE = 1,
};
-enum ofp_flow_wildcards {
+enum ofp_flow_wildcards(wire_type=uint32_t, bitmask=True) {
OFPFW_IN_PORT = 0x1,
OFPFW_DL_VLAN = 0x2,
OFPFW_DL_SRC = 0x4,
@@ -159,7 +162,7 @@
OFPFW_ALL = 0x3fffff,
};
-enum ofp_action_type {
+enum ofp_action_type(wire_type=uint16_t) {
OFPAT_OUTPUT = 0,
OFPAT_SET_VLAN_VID = 1,
OFPAT_SET_VLAN_PCP = 2,
@@ -175,7 +178,7 @@
OFPAT_VENDOR = 0xffff,
};
-enum ofp_capabilities {
+enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
OFPC_FLOW_STATS = 0x1,
OFPC_TABLE_STATS = 0x2,
OFPC_PORT_STATS = 0x4,
@@ -186,14 +189,14 @@
OFPC_ARP_MATCH_IP = 0x80,
};
-enum ofp_config_flags {
+enum ofp_config_flags(wire_type=uint32_t, bitmask=True) {
OFPC_FRAG_NORMAL = 0x0,
OFPC_FRAG_DROP = 0x1,
OFPC_FRAG_REASM = 0x2,
OFPC_FRAG_MASK = 0x3,
};
-enum ofp_flow_mod_command {
+enum ofp_flow_mod_command(wire_type=uint16_t) {
OFPFC_ADD = 0,
OFPFC_MODIFY = 1,
OFPFC_MODIFY_STRICT = 2,
@@ -201,17 +204,17 @@
OFPFC_DELETE_STRICT = 4,
};
-enum ofp_flow_mod_flags {
+enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
OFPFF_SEND_FLOW_REM = 0x1,
OFPFF_CHECK_OVERLAP = 0x2,
OFPFF_EMERG = 0x4,
};
-enum ofp_stats_reply_flags {
+enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
OFPSF_REPLY_MORE = 0x1,
};
-enum ofp_stats_types {
+enum ofp_stats_types(wire_type=uint16_t) {
OFPST_DESC = 0,
OFPST_FLOW = 1,
OFPST_AGGREGATE = 2,
@@ -221,24 +224,24 @@
OFPST_VENDOR = 0xffff,
};
-enum ofp_packet_in_reason {
+enum ofp_packet_in_reason(wire_type=uint8_t) {
OFPR_NO_MATCH = 0,
OFPR_ACTION = 1,
};
-enum ofp_flow_removed_reason {
+enum ofp_flow_removed_reason(wire_type=uint8_t) {
OFPRR_IDLE_TIMEOUT = 0,
OFPRR_HARD_TIMEOUT = 1,
OFPRR_DELETE = 2,
};
-enum ofp_port_reason {
+enum ofp_port_reason(wire_type=uint8_t) {
OFPPR_ADD = 0,
OFPPR_DELETE = 1,
OFPPR_MODIFY = 2,
};
-enum ofp_error_type {
+enum ofp_error_type(wire_type=uint16_t) {
OFPET_HELLO_FAILED = 0,
OFPET_BAD_REQUEST = 1,
OFPET_BAD_ACTION = 2,
@@ -247,12 +250,12 @@
OFPET_QUEUE_OP_FAILED = 5,
};
-enum ofp_hello_failed_code {
+enum ofp_hello_failed_code(wire_type=uint16_t) {
OFPHFC_INCOMPATIBLE = 0,
OFPHFC_EPERM = 1,
};
-enum ofp_bad_request_code {
+enum ofp_bad_request_code(wire_type=uint16_t) {
OFPBRC_BAD_VERSION = 0,
OFPBRC_BAD_TYPE = 1,
OFPBRC_BAD_STAT = 2,
@@ -264,7 +267,7 @@
OFPBRC_BUFFER_UNKNOWN = 8,
};
-enum ofp_bad_action_code {
+enum ofp_bad_action_code(wire_type=uint16_t) {
OFPBAC_BAD_TYPE = 0,
OFPBAC_BAD_LEN = 1,
OFPBAC_BAD_VENDOR = 2,
@@ -276,7 +279,7 @@
OFPBAC_BAD_QUEUE = 8,
};
-enum ofp_flow_mod_failed_code {
+enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
OFPFMFC_ALL_TABLES_FULL = 0,
OFPFMFC_OVERLAP = 1,
OFPFMFC_EPERM = 2,
@@ -285,12 +288,12 @@
OFPFMFC_UNSUPPORTED = 5,
};
-enum ofp_port_mod_failed_code {
+enum ofp_port_mod_failed_code(wire_type=uint16_t) {
OFPPMFC_BAD_PORT = 0,
OFPPMFC_BAD_HW_ADDR = 1,
};
-enum ofp_queue_op_failed_code {
+enum ofp_queue_op_failed_code(wire_type=uint16_t) {
OFPQOFC_BAD_PORT = 0,
OFPQOFC_BAD_QUEUE = 1,
OFPQOFC_EPERM = 2,
diff --git a/openflow_input/standard-1.1 b/openflow_input/standard-1.1
index 553e665..18faaa8 100644
--- a/openflow_input/standard-1.1
+++ b/openflow_input/standard-1.1
@@ -63,7 +63,7 @@
OFPQ_MIN_RATE_UNCFG = 0xffff,
};
-enum ofp_port {
+enum ofp_port(wire_type=uint32_t) {
OFPP_MAX = 0xffffff00,
OFPP_IN_PORT = 0xfffffff8,
OFPP_TABLE = 0xfffffff9,
@@ -74,11 +74,11 @@
OFPP_LOCAL = 0xfffffffe,
};
-enum ofp_port_no {
+enum ofp_port_no(wire_type=uint32_t, complete=no) {
OFPP_ANY = 0xffffffff,
};
-enum ofp_type {
+enum ofp_type(wire_type=uint8_t) {
OFPT_HELLO = 0,
OFPT_ERROR = 1,
OFPT_ECHO_REQUEST = 2,
@@ -105,22 +105,22 @@
OFPT_QUEUE_GET_CONFIG_REPLY = 23,
};
-enum ofp_config_flags {
+enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
OFPC_FRAG_NORMAL = 0,
OFPC_FRAG_DROP = 1,
OFPC_FRAG_REASM = 2,
- OFPC_FRAG_MASK = 3,
+ OFPC_FRAG_MASK(virtual=True) = 3,
OFPC_INVALID_TTL_TO_CONTROLLER = 4,
};
-enum ofp_table_config {
+enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
OFPTC_TABLE_MISS_CONTROLLER = 0,
OFPTC_TABLE_MISS_CONTINUE = 1,
OFPTC_TABLE_MISS_DROP = 2,
- OFPTC_TABLE_MISS_MASK = 3,
+ OFPTC_TABLE_MISS_MASK(virtual=True) = 3,
};
-enum ofp_capabilities {
+enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
OFPC_FLOW_STATS = 0x1,
OFPC_TABLE_STATS = 0x2,
OFPC_PORT_STATS = 0x4,
@@ -130,20 +130,20 @@
OFPC_ARP_MATCH_IP = 0x80,
};
-enum ofp_port_config {
+enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
OFPPC_PORT_DOWN = 0x1,
OFPPC_NO_RECV = 0x4,
OFPPC_NO_FWD = 0x20,
OFPPC_NO_PACKET_IN = 0x40,
};
-enum ofp_port_state {
+enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
OFPPS_LINK_DOWN = 0x1,
OFPPS_BLOCKED = 0x2,
OFPPS_LIVE = 0x4,
};
-enum ofp_port_features {
+enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
OFPPF_10MB_HD = 0x1,
OFPPF_10MB_FD = 0x2,
OFPPF_100MB_HD = 0x4,
@@ -162,18 +162,18 @@
OFPPF_PAUSE_ASYM = 0x8000,
};
-enum ofp_port_reason {
+enum ofp_port_reason(wire_type=uint8_t) {
OFPPR_ADD = 0,
OFPPR_DELETE = 1,
OFPPR_MODIFY = 2,
};
-enum ofp_packet_in_reason {
+enum ofp_packet_in_reason(wire_type=uint8_t) {
OFPR_NO_MATCH = 0,
OFPR_ACTION = 1,
};
-enum ofp_action_type {
+enum ofp_action_type(wire_type=uint16_t) {
OFPAT_OUTPUT = 0,
OFPAT_SET_VLAN_VID = 1,
OFPAT_SET_VLAN_PCP = 2,
@@ -202,7 +202,7 @@
OFPAT_EXPERIMENTER = 0xffff,
};
-enum ofp_flow_mod_command {
+enum ofp_flow_mod_command(wire_type=uint8_t) {
OFPFC_ADD = 0,
OFPFC_MODIFY = 1,
OFPFC_MODIFY_STRICT = 2,
@@ -210,13 +210,13 @@
OFPFC_DELETE_STRICT = 4,
};
-enum ofp_group_mod_command {
+enum ofp_group_mod_command(wire_type=uint16_t) {
OFPGC_ADD = 0,
OFPGC_MODIFY = 1,
OFPGC_DELETE = 2,
};
-enum ofp_flow_wildcards {
+enum ofp_flow_wildcards(wire_type=uint32_t, bitmask=True) {
OFPFW_IN_PORT = 0x1,
OFPFW_DL_VLAN = 0x2,
OFPFW_DL_VLAN_PCP = 0x4,
@@ -227,19 +227,19 @@
OFPFW_TP_DST = 0x80,
OFPFW_MPLS_LABEL = 0x100,
OFPFW_MPLS_TC = 0x200,
- OFPFW_ALL = 0x3ff,
+ OFPFW_ALL(virtual=True) = 0x3ff,
};
-enum ofp_vlan_id {
+enum ofp_vlan_id(wire_type=uint16_t) {
OFPVID_ANY = 0xfffe,
OFPVID_NONE = 0xffff,
};
-enum ofp_match_type {
+enum ofp_match_type(wire_type=uint16_t) {
OFPMT_STANDARD = 0,
};
-enum ofp_instruction_type {
+enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
OFPIT_GOTO_TABLE = 0x1,
OFPIT_WRITE_METADATA = 0x2,
OFPIT_WRITE_ACTIONS = 0x3,
@@ -248,32 +248,32 @@
OFPIT_EXPERIMENTER = 0xffff,
};
-enum ofp_flow_mod_flags {
+enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
OFPFF_SEND_FLOW_REM = 0x1,
OFPFF_CHECK_OVERLAP = 0x2,
};
-enum ofp_group {
+enum ofp_group(wire_type=uint32_t, complete=False) {
OFPG_MAX = 0xffffff00,
OFPG_ALL = 0xfffffffc,
OFPG_ANY = 0xffffffff,
};
-enum ofp_group_type {
+enum ofp_group_type(wire_type=uint8_t) {
OFPGT_ALL = 0,
OFPGT_SELECT = 1,
OFPGT_INDIRECT = 2,
OFPGT_FF = 3,
};
-enum ofp_flow_removed_reason {
+enum ofp_flow_removed_reason(wire_type=uint8_t) {
OFPRR_IDLE_TIMEOUT = 0,
OFPRR_HARD_TIMEOUT = 1,
OFPRR_DELETE = 2,
OFPRR_GROUP_DELETE = 3,
};
-enum ofp_error_type {
+enum ofp_error_type(wire_type=uint16_t) {
OFPET_HELLO_FAILED = 0,
OFPET_BAD_REQUEST = 1,
OFPET_BAD_ACTION = 2,
@@ -287,12 +287,12 @@
OFPET_SWITCH_CONFIG_FAILED = 10,
};
-enum ofp_hello_failed_code {
+enum ofp_hello_failed_code(wire_type=uint16_t) {
OFPHFC_INCOMPATIBLE = 0,
OFPHFC_EPERM = 1,
};
-enum ofp_bad_request_code {
+enum ofp_bad_request_code(wire_type=uint16_t) {
OFPBRC_BAD_VERSION = 0,
OFPBRC_BAD_TYPE = 1,
OFPBRC_BAD_STAT = 2,
@@ -305,7 +305,7 @@
OFPBRC_BAD_TABLE_ID = 9,
};
-enum ofp_bad_action_code {
+enum ofp_bad_action_code(wire_type=uint16_t) {
OFPBAC_BAD_TYPE = 0,
OFPBAC_BAD_LEN = 1,
OFPBAC_BAD_EXPERIMENTER = 2,
@@ -321,7 +321,7 @@
OFPBAC_BAD_TAG = 12,
};
-enum ofp_bad_instruction_code {
+enum ofp_bad_instruction_code(wire_type=uint16_t) {
OFPBIC_UNKNOWN_INST = 0,
OFPBIC_UNSUP_INST = 1,
OFPBIC_BAD_TABLE_ID = 2,
@@ -330,7 +330,7 @@
OFPBIC_UNSUP_EXP_INST = 5,
};
-enum ofp_bad_match_code {
+enum ofp_bad_match_code(wire_type=uint16_t) {
OFPBMC_BAD_TYPE = 0,
OFPBMC_BAD_LEN = 1,
OFPBMC_BAD_TAG = 2,
@@ -341,7 +341,7 @@
OFPBMC_BAD_VALUE = 7,
};
-enum ofp_flow_mod_failed_code {
+enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
OFPFMFC_UNKNOWN = 0,
OFPFMFC_TABLE_FULL = 1,
OFPFMFC_BAD_TABLE_ID = 2,
@@ -351,7 +351,7 @@
OFPFMFC_BAD_COMMAND = 6,
};
-enum ofp_group_mod_failed_code {
+enum ofp_group_mod_failed_code(wire_type=uint16_t) {
OFPGMFC_GROUP_EXISTS = 0,
OFPGMFC_INVALID_GROUP = 1,
OFPGMFC_WEIGHT_UNSUPPORTED = 2,
@@ -363,30 +363,30 @@
OFPGMFC_UNKNOWN_GROUP = 8,
};
-enum ofp_port_mod_failed_code {
+enum ofp_port_mod_failed_code(wire_type=uint16_t) {
OFPPMFC_BAD_PORT = 0,
OFPPMFC_BAD_HW_ADDR = 1,
OFPPMFC_BAD_CONFIG = 2,
OFPPMFC_BAD_ADVERTISE = 3,
};
-enum ofp_table_mod_failed_code {
+enum ofp_table_mod_failed_code(wire_type=uint16_t) {
OFPTMFC_BAD_TABLE = 0,
OFPTMFC_BAD_CONFIG = 1,
};
-enum ofp_queue_op_failed_code {
+enum ofp_queue_op_failed_code(wire_type=uint16_t) {
OFPQOFC_BAD_PORT = 0,
OFPQOFC_BAD_QUEUE = 1,
OFPQOFC_EPERM = 2,
};
-enum ofp_switch_config_failed_code {
+enum ofp_switch_config_failed_code(wire_type=uint16_t) {
OFPSCFC_BAD_FLAGS = 0,
OFPSCFC_BAD_LEN = 1,
};
-enum ofp_stats_types {
+enum ofp_stats_types(wire_type=uint16_t) {
OFPST_DESC = 0,
OFPST_FLOW = 1,
OFPST_AGGREGATE = 2,
@@ -398,11 +398,11 @@
OFPST_EXPERIMENTER = 0xffff,
};
-enum ofp_stats_reply_flags {
+enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
OFPSF_REPLY_MORE = 0x1,
};
-enum ofp_queue_properties {
+enum ofp_queue_properties(wire_type=uint16_t) {
OFPQT_NONE = 0,
OFPQT_MIN_RATE = 1,
};
diff --git a/openflow_input/standard-1.2 b/openflow_input/standard-1.2
index 8b4fa3f..f4d31d6 100644
--- a/openflow_input/standard-1.2
+++ b/openflow_input/standard-1.2
@@ -59,7 +59,7 @@
OFPQ_MAX_RATE_UNCFG = 0xffff,
};
-enum ofp_port {
+enum ofp_port(wire_type=uint32_t) {
OFPP_MAX = 0xffffff00,
OFPP_IN_PORT = 0xfffffff8,
OFPP_TABLE = 0xfffffff9,
@@ -70,11 +70,11 @@
OFPP_LOCAL = 0xfffffffe,
};
-enum ofp_port_no {
+enum ofp_port_no(wire_type=uint32_t, complete=no) {
OFPP_ANY = 0xffffffff,
};
-enum ofp_type {
+enum ofp_type(wire_type=uint8_t) {
OFPT_HELLO = 0,
OFPT_ERROR = 1,
OFPT_ECHO_REQUEST = 2,
@@ -103,7 +103,7 @@
OFPT_ROLE_REPLY = 25,
};
-enum ofp_config_flags {
+enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
OFPC_FRAG_NORMAL = 0,
OFPC_FRAG_DROP = 1,
OFPC_FRAG_REASM = 2,
@@ -111,19 +111,19 @@
OFPC_INVALID_TTL_TO_CONTROLLER = 4,
};
-enum ofp_table_config {
+enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
OFPTC_TABLE_MISS_CONTROLLER = 0,
OFPTC_TABLE_MISS_CONTINUE = 1,
OFPTC_TABLE_MISS_DROP = 2,
OFPTC_TABLE_MISS_MASK = 3,
};
-enum ofp_table {
+enum ofp_table(wire_type=uint8_t, complete=False) {
OFPTT_MAX = 0xfe,
OFPTT_ALL = 0xff,
};
-enum ofp_capabilities {
+enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
OFPC_FLOW_STATS = 0x1,
OFPC_TABLE_STATS = 0x2,
OFPC_PORT_STATS = 0x4,
@@ -133,20 +133,20 @@
OFPC_PORT_BLOCKED = 0x100,
};
-enum ofp_port_config {
+enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
OFPPC_PORT_DOWN = 0x1,
OFPPC_NO_RECV = 0x4,
OFPPC_NO_FWD = 0x20,
OFPPC_NO_PACKET_IN = 0x40,
};
-enum ofp_port_state {
+enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
OFPPS_LINK_DOWN = 0x1,
OFPPS_BLOCKED = 0x2,
OFPPS_LIVE = 0x4,
};
-enum ofp_port_features {
+enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
OFPPF_10MB_HD = 0x1,
OFPPF_10MB_FD = 0x2,
OFPPF_100MB_HD = 0x4,
@@ -165,30 +165,30 @@
OFPPF_PAUSE_ASYM = 0x8000,
};
-enum ofp_port_reason {
+enum ofp_port_reason(wire_type=uint8_t) {
OFPPR_ADD = 0,
OFPPR_DELETE = 1,
OFPPR_MODIFY = 2,
};
-enum ofp_match_type {
+enum ofp_match_type(wire_type=uint16_t) {
OFPMT_STANDARD = 0,
OFPMT_OXM = 1,
};
-enum ofp_oxm_class {
+enum ofp_oxm_class(wire_type=uint16_t) {
OFPXMC_NXM_0 = 0,
OFPXMC_NXM_1 = 1,
OFPXMC_OPENFLOW_BASIC = 0x8000,
OFPXMC_EXPERIMENTER = 0xffff,
};
-enum ofp_vlan_id {
+enum ofp_vlan_id(wire_type=uint16_t) {
OFPVID_NONE = 0,
OFPVID_PRESENT = 0x1000,
};
-enum ofp_action_type {
+enum ofp_action_type(wire_type=uint16_t) {
OFPAT_OUTPUT = 0,
OFPAT_COPY_TTL_OUT = 0xb,
OFPAT_COPY_TTL_IN = 0xc,
@@ -206,12 +206,12 @@
OFPAT_EXPERIMENTER = 0xffff,
};
-enum ofp_controller_max_len {
+enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
OFPCML_MAX = 0xffe5,
OFPCML_NO_BUFFER = 0xffff,
};
-enum ofp_instruction_type {
+enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
OFPIT_GOTO_TABLE = 0x1,
OFPIT_WRITE_METADATA = 0x2,
OFPIT_WRITE_ACTIONS = 0x3,
@@ -220,7 +220,7 @@
OFPIT_EXPERIMENTER = 0xffff,
};
-enum ofp_flow_mod_command {
+enum ofp_flow_mod_command(wire_type=uint8_t) {
OFPFC_ADD = 0,
OFPFC_MODIFY = 1,
OFPFC_MODIFY_STRICT = 2,
@@ -228,45 +228,45 @@
OFPFC_DELETE_STRICT = 4,
};
-enum ofp_flow_mod_flags {
+enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
OFPFF_SEND_FLOW_REM = 0x1,
OFPFF_CHECK_OVERLAP = 0x2,
OFPFF_RESET_COUNTS = 0x4,
};
-enum ofp_group {
+enum ofp_group(wire_type=uint32_t, complete=False) {
OFPG_MAX = 0xffffff00,
OFPG_ALL = 0xfffffffc,
OFPG_ANY = 0xffffffff,
};
-enum ofp_group_mod_command {
+enum ofp_group_mod_command(wire_type=uint16_t) {
OFPGC_ADD = 0,
OFPGC_MODIFY = 1,
OFPGC_DELETE = 2,
};
-enum ofp_group_type {
+enum ofp_group_type(wire_type=uint8_t) {
OFPGT_ALL = 0,
OFPGT_SELECT = 1,
OFPGT_INDIRECT = 2,
OFPGT_FF = 3,
};
-enum ofp_packet_in_reason {
+enum ofp_packet_in_reason(wire_type=uint8_t) {
OFPR_NO_MATCH = 0,
OFPR_ACTION = 1,
OFPR_INVALID_TTL = 2,
};
-enum ofp_flow_removed_reason {
+enum ofp_flow_removed_reason(wire_type=uint8_t) {
OFPRR_IDLE_TIMEOUT = 0,
OFPRR_HARD_TIMEOUT = 1,
OFPRR_DELETE = 2,
OFPRR_GROUP_DELETE = 3,
};
-enum ofp_error_type {
+enum ofp_error_type(wire_type=uint16_t) {
OFPET_HELLO_FAILED = 0,
OFPET_BAD_REQUEST = 1,
OFPET_BAD_ACTION = 2,
@@ -282,12 +282,12 @@
OFPET_EXPERIMENTER = 0xffff,
};
-enum ofp_hello_failed_code {
+enum ofp_hello_failed_code(wire_type=uint16_t) {
OFPHFC_INCOMPATIBLE = 0,
OFPHFC_EPERM = 1,
};
-enum ofp_bad_request_code {
+enum ofp_bad_request_code(wire_type=uint16_t) {
OFPBRC_BAD_VERSION = 0,
OFPBRC_BAD_TYPE = 1,
OFPBRC_BAD_STAT = 2,
@@ -303,7 +303,7 @@
OFPBRC_BAD_PACKET = 12,
};
-enum ofp_bad_action_code {
+enum ofp_bad_action_code(wire_type=uint16_t) {
OFPBAC_BAD_TYPE = 0,
OFPBAC_BAD_LEN = 1,
OFPBAC_BAD_EXPERIMENTER = 2,
@@ -322,7 +322,7 @@
OFPBAC_BAD_SET_ARGUMENT = 15,
};
-enum ofp_bad_instruction_code {
+enum ofp_bad_instruction_code(wire_type=uint16_t) {
OFPBIC_UNKNOWN_INST = 0,
OFPBIC_UNSUP_INST = 1,
OFPBIC_BAD_TABLE_ID = 2,
@@ -334,7 +334,7 @@
OFPBIC_EPERM = 8,
};
-enum ofp_bad_match_code {
+enum ofp_bad_match_code(wire_type=uint16_t) {
OFPBMC_BAD_TYPE = 0,
OFPBMC_BAD_LEN = 1,
OFPBMC_BAD_TAG = 2,
@@ -349,7 +349,7 @@
OFPBMC_EPERM = 11,
};
-enum ofp_flow_mod_failed_code {
+enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
OFPFMFC_UNKNOWN = 0,
OFPFMFC_TABLE_FULL = 1,
OFPFMFC_BAD_TABLE_ID = 2,
@@ -360,7 +360,7 @@
OFPFMFC_BAD_FLAGS = 7,
};
-enum ofp_group_mod_failed_code {
+enum ofp_group_mod_failed_code(wire_type=uint16_t) {
OFPGMFC_GROUP_EXISTS = 0,
OFPGMFC_INVALID_GROUP = 1,
OFPGMFC_WEIGHT_UNSUPPORTED = 2,
@@ -378,7 +378,7 @@
OFPGMFC_EPERM = 14,
};
-enum ofp_port_mod_failed_code {
+enum ofp_port_mod_failed_code(wire_type=uint16_t) {
OFPPMFC_BAD_PORT = 0,
OFPPMFC_BAD_HW_ADDR = 1,
OFPPMFC_BAD_CONFIG = 2,
@@ -386,31 +386,31 @@
OFPPMFC_EPERM = 4,
};
-enum ofp_table_mod_failed_code {
+enum ofp_table_mod_failed_code(wire_type=uint16_t) {
OFPTMFC_BAD_TABLE = 0,
OFPTMFC_BAD_CONFIG = 1,
OFPTMFC_EPERM = 2,
};
-enum ofp_queue_op_failed_code {
+enum ofp_queue_op_failed_code(wire_type=uint16_t) {
OFPQOFC_BAD_PORT = 0,
OFPQOFC_BAD_QUEUE = 1,
OFPQOFC_EPERM = 2,
};
-enum ofp_switch_config_failed_code {
+enum ofp_switch_config_failed_code(wire_type=uint16_t) {
OFPSCFC_BAD_FLAGS = 0,
OFPSCFC_BAD_LEN = 1,
OFPSCFC_EPERM = 2,
};
-enum ofp_role_request_failed_code {
+enum ofp_role_request_failed_code (wire_type=uint16_t){
OFPRRFC_STALE = 0,
OFPRRFC_UNSUP = 1,
OFPRRFC_BAD_ROLE = 2,
};
-enum ofp_stats_types {
+enum ofp_stats_types(wire_type=uint16_t) {
OFPST_DESC = 0,
OFPST_FLOW = 1,
OFPST_AGGREGATE = 2,
@@ -423,24 +423,24 @@
OFPST_EXPERIMENTER = 0xffff,
};
-enum ofp_stats_reply_flags {
+enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
OFPSF_REPLY_MORE = 0x1,
};
-enum ofp_group_capabilities {
+enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
OFPGFC_SELECT_WEIGHT = 0x1,
OFPGFC_SELECT_LIVENESS = 0x2,
OFPGFC_CHAINING = 0x4,
OFPGFC_CHAINING_CHECKS = 0x8,
};
-enum ofp_queue_properties {
+enum ofp_queue_properties(wire_type=uint16_t) {
OFPQT_MIN_RATE = 0x1,
OFPQT_MAX_RATE = 0x2,
OFPQT_EXPERIMENTER = 0xffff,
};
-enum ofp_controller_role {
+enum ofp_controller_role(wire_type=uint32_t) {
OFPCR_ROLE_NOCHANGE = 0,
OFPCR_ROLE_EQUAL = 1,
OFPCR_ROLE_MASTER = 2,
diff --git a/openflow_input/standard-1.3 b/openflow_input/standard-1.3
index 0d5cec3..b0aa242 100644
--- a/openflow_input/standard-1.3
+++ b/openflow_input/standard-1.3
@@ -58,11 +58,11 @@
OFPQ_MIN_RATE_UNCFG = 0xffff,
};
-enum ofp_port_no {
+enum ofp_port_no(wire_type=uint32_t, complete=no) {
OFPP_ANY = 0xffffffff,
};
-enum ofp_port {
+enum ofp_port(wire_type=uint32_t) {
OFPP_MAX = 0xffffff00,
OFPP_IN_PORT = 0xfffffff8,
OFPP_TABLE = 0xfffffff9,
@@ -73,7 +73,7 @@
OFPP_LOCAL = 0xfffffffe,
};
-enum ofp_type {
+enum ofp_type(wire_type=uint8_t) {
OFPT_HELLO = 0,
OFPT_ERROR = 1,
OFPT_ECHO_REQUEST = 2,
@@ -106,23 +106,23 @@
OFPT_METER_MOD = 29,
};
-enum ofp_config_flags {
+enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
OFPC_FRAG_NORMAL = 0,
OFPC_FRAG_DROP = 1,
OFPC_FRAG_REASM = 2,
OFPC_FRAG_MASK = 3,
};
-enum ofp_table_config {
+enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
OFPTC_DEPRECATED_MASK = 0x3,
};
-enum ofp_table {
+enum ofp_table(wire_type=uint8_t, complete=False) {
OFPTT_MAX = 0xfe,
OFPTT_ALL = 0xff,
};
-enum ofp_capabilities {
+enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
OFPC_FLOW_STATS = 0x1,
OFPC_TABLE_STATS = 0x2,
OFPC_PORT_STATS = 0x4,
@@ -132,20 +132,20 @@
OFPC_PORT_BLOCKED = 0x100,
};
-enum ofp_port_config {
+enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
OFPPC_PORT_DOWN = 0x1,
OFPPC_NO_RECV = 0x4,
OFPPC_NO_FWD = 0x20,
OFPPC_NO_PACKET_IN = 0x40,
};
-enum ofp_port_state {
+enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
OFPPS_LINK_DOWN = 0x1,
OFPPS_BLOCKED = 0x2,
OFPPS_LIVE = 0x4,
};
-enum ofp_port_features {
+enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
OFPPF_10MB_HD = 0x1,
OFPPF_10MB_FD = 0x2,
OFPPF_100MB_HD = 0x4,
@@ -164,30 +164,32 @@
OFPPF_PAUSE_ASYM = 0x8000,
};
-enum ofp_port_reason {
+enum ofp_port_reason(wire_type=uint8_t) {
OFPPR_ADD = 0,
OFPPR_DELETE = 1,
OFPPR_MODIFY = 2,
};
-enum ofp_match_type {
+enum ofp_match_type(wire_type=uint16_t) {
OFPMT_STANDARD = 0,
OFPMT_OXM = 1,
};
-enum ofp_oxm_class {
+enum ofp_oxm_class(wire_type=uint16_t) {
OFPXMC_NXM_0 = 0,
OFPXMC_NXM_1 = 1,
OFPXMC_OPENFLOW_BASIC = 0x8000,
OFPXMC_EXPERIMENTER = 0xffff,
};
-enum ofp_vlan_id {
+enum ofp_vlan_id(wire_type=uint16_t) {
OFPVID_NONE = 0,
OFPVID_PRESENT = 0x1000,
};
-enum ofp_ipv6exthdr_flags {
+// FIXME: OF spec specified this as '9' bits, implicitly adding
+// to full byte
+enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
OFPIEH_NONEXT = 0x1,
OFPIEH_ESP = 0x2,
OFPIEH_AUTH = 0x4,
@@ -199,7 +201,7 @@
OFPIEH_UNSEQ = 0x100,
};
-enum ofp_action_type {
+enum ofp_action_type(wire_type=uint16_t) {
OFPAT_OUTPUT = 0,
OFPAT_COPY_TTL_OUT = 0xb,
OFPAT_COPY_TTL_IN = 0xc,
@@ -219,12 +221,12 @@
OFPAT_EXPERIMENTER = 0xffff,
};
-enum ofp_controller_max_len {
+enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
OFPCML_MAX = 0xffe5,
OFPCML_NO_BUFFER = 0xffff,
};
-enum ofp_instruction_type {
+enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
OFPIT_GOTO_TABLE = 0x1,
OFPIT_WRITE_METADATA = 0x2,
OFPIT_WRITE_ACTIONS = 0x3,
@@ -234,7 +236,7 @@
OFPIT_EXPERIMENTER = 0xffff,
};
-enum ofp_flow_mod_command {
+enum ofp_flow_mod_command(wire_type=uint8_t) {
OFPFC_ADD = 0,
OFPFC_MODIFY = 1,
OFPFC_MODIFY_STRICT = 2,
@@ -242,7 +244,7 @@
OFPFC_DELETE_STRICT = 4,
};
-enum ofp_flow_mod_flags {
+enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
OFPFF_SEND_FLOW_REM = 0x1,
OFPFF_CHECK_OVERLAP = 0x2,
OFPFF_RESET_COUNTS = 0x4,
@@ -250,65 +252,65 @@
OFPFF_NO_BYT_COUNTS = 0x10,
};
-enum ofp_group {
+enum ofp_group(wire_type=uint32_t, complete=False) {
OFPG_MAX = 0xffffff00,
OFPG_ALL = 0xfffffffc,
OFPG_ANY = 0xffffffff,
};
-enum ofp_group_mod_command {
+enum ofp_group_mod_command(wire_type=uint16_t) {
OFPGC_ADD = 0,
OFPGC_MODIFY = 1,
OFPGC_DELETE = 2,
};
-enum ofp_group_type {
+enum ofp_group_type(wire_type=uint8_t) {
OFPGT_ALL = 0,
OFPGT_SELECT = 1,
OFPGT_INDIRECT = 2,
OFPGT_FF = 3,
};
-enum ofp_packet_in_reason {
+enum ofp_packet_in_reason(wire_type=uint8_t) {
OFPR_NO_MATCH = 0,
OFPR_ACTION = 1,
OFPR_INVALID_TTL = 2,
};
-enum ofp_flow_removed_reason {
+enum ofp_flow_removed_reason(wire_type=uint8_t) {
OFPRR_IDLE_TIMEOUT = 0,
OFPRR_HARD_TIMEOUT = 1,
OFPRR_DELETE = 2,
OFPRR_GROUP_DELETE = 3,
};
-enum ofp_meter {
+enum ofp_meter(wire_type=uint32_t, complete=False) {
OFPM_MAX = 0xffff0000,
OFPM_SLOWPATH = 0xfffffffd,
OFPM_CONTROLLER = 0xfffffffe,
OFPM_ALL = 0xffffffff,
};
-enum ofp_meter_band_type {
+enum ofp_meter_band_type(wire_type=uint16_t) {
OFPMBT_DROP = 0x1,
OFPMBT_DSCP_REMARK = 0x2,
OFPMBT_EXPERIMENTER = 0xffff,
};
-enum ofp_meter_mod_command {
+enum ofp_meter_mod_command(wire_type=uint16_t) {
OFPMC_ADD = 0,
OFPMC_MODIFY = 1,
OFPMC_DELETE = 2,
};
-enum ofp_meter_flags {
+enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
OFPMF_KBPS = 0x1,
OFPMF_PKTPS = 0x2,
OFPMF_BURST = 0x4,
OFPMF_STATS = 0x8,
};
-enum ofp_error_type {
+enum ofp_error_type(wire_type=uint16_t) {
OFPET_HELLO_FAILED = 0,
OFPET_BAD_REQUEST = 1,
OFPET_BAD_ACTION = 2,
@@ -326,12 +328,12 @@
OFPET_EXPERIMENTER = 0xffff,
};
-enum ofp_hello_failed_code {
+enum ofp_hello_failed_code(wire_type=uint16_t) {
OFPHFC_INCOMPATIBLE = 0,
OFPHFC_EPERM = 1,
};
-enum ofp_bad_request_code {
+enum ofp_bad_request_code(wire_type=uint16_t) {
OFPBRC_BAD_VERSION = 0,
OFPBRC_BAD_TYPE = 1,
OFPBRC_BAD_MULTIPART = 2,
@@ -348,7 +350,7 @@
OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
};
-enum ofp_bad_action_code {
+enum ofp_bad_action_code(wire_type=uint16_t) {
OFPBAC_BAD_TYPE = 0,
OFPBAC_BAD_LEN = 1,
OFPBAC_BAD_EXPERIMENTER = 2,
@@ -367,7 +369,7 @@
OFPBAC_BAD_SET_ARGUMENT = 15,
};
-enum ofp_bad_instruction_code {
+enum ofp_bad_instruction_code(wire_type=uint16_t) {
OFPBIC_UNKNOWN_INST = 0,
OFPBIC_UNSUP_INST = 1,
OFPBIC_BAD_TABLE_ID = 2,
@@ -379,7 +381,7 @@
OFPBIC_EPERM = 8,
};
-enum ofp_bad_match_code {
+enum ofp_bad_match_code(wire_type=uint16_t) {
OFPBMC_BAD_TYPE = 0,
OFPBMC_BAD_LEN = 1,
OFPBMC_BAD_TAG = 2,
@@ -394,7 +396,7 @@
OFPBMC_EPERM = 11,
};
-enum ofp_flow_mod_failed_code {
+enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
OFPFMFC_UNKNOWN = 0,
OFPFMFC_TABLE_FULL = 1,
OFPFMFC_BAD_TABLE_ID = 2,
@@ -405,7 +407,7 @@
OFPFMFC_BAD_FLAGS = 7,
};
-enum ofp_group_mod_failed_code {
+enum ofp_group_mod_failed_code(wire_type=uint16_t) {
OFPGMFC_GROUP_EXISTS = 0,
OFPGMFC_INVALID_GROUP = 1,
OFPGMFC_WEIGHT_UNSUPPORTED = 2,
@@ -423,7 +425,7 @@
OFPGMFC_EPERM = 14,
};
-enum ofp_port_mod_failed_code {
+enum ofp_port_mod_failed_code(wire_type=uint16_t) {
OFPPMFC_BAD_PORT = 0,
OFPPMFC_BAD_HW_ADDR = 1,
OFPPMFC_BAD_CONFIG = 2,
@@ -431,31 +433,31 @@
OFPPMFC_EPERM = 4,
};
-enum ofp_table_mod_failed_code {
+enum ofp_table_mod_failed_code(wire_type=uint16_t) {
OFPTMFC_BAD_TABLE = 0,
OFPTMFC_BAD_CONFIG = 1,
OFPTMFC_EPERM = 2,
};
-enum ofp_queue_op_failed_code {
+enum ofp_queue_op_failed_code(wire_type=uint16_t) {
OFPQOFC_BAD_PORT = 0,
OFPQOFC_BAD_QUEUE = 1,
OFPQOFC_EPERM = 2,
};
-enum ofp_switch_config_failed_code {
+enum ofp_switch_config_failed_code(wire_type=uint16_t) {
OFPSCFC_BAD_FLAGS = 0,
OFPSCFC_BAD_LEN = 1,
OFPSCFC_EPERM = 2,
};
-enum ofp_role_request_failed_code {
+enum ofp_role_request_failed_code(wire_type=uint16_t){
OFPRRFC_STALE = 0,
OFPRRFC_UNSUP = 1,
OFPRRFC_BAD_ROLE = 2,
};
-enum ofp_meter_mod_failed_code {
+enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
OFPMMFC_UNKNOWN = 0,
OFPMMFC_METER_EXISTS = 1,
OFPMMFC_INVALID_METER = 2,
@@ -470,7 +472,7 @@
OFPMMFC_OUT_OF_BANDS = 11,
};
-enum ofp_table_features_failed_code {
+enum ofp_table_features_failed_code(wire_type=uint16_t) {
OFPTFFC_BAD_TABLE = 0,
OFPTFFC_BAD_METADATA = 1,
OFPTFFC_BAD_TYPE = 2,
@@ -479,7 +481,7 @@
OFPTFFC_EPERM = 5,
};
-enum ofp_multipart_types {
+enum ofp_multipart_types(wire_type=uint16_t) {
OFPMP_DESC = 0,
OFPMP_FLOW = 1,
OFPMP_AGGREGATE = 2,
@@ -497,15 +499,15 @@
OFPMP_EXPERIMENTER = 0xffff,
};
-enum ofp_multipart_request_flags {
+enum ofp_multipart_request_flags(wire_type=uint16_t, bitmask=True) {
OFPMPF_REQ_MORE = 0x1,
};
-enum ofp_multipart_reply_flags {
+enum ofp_multipart_reply_flags(wire_type=uint16_t, bitmask=True) {
OFPMPF_REPLY_MORE = 0x1,
};
-enum ofp_table_feature_prop_type {
+enum ofp_table_feature_prop_type(wire_type=uint16_t) {
OFPTFPT_INSTRUCTIONS = 0,
OFPTFPT_INSTRUCTIONS_MISS = 1,
OFPTFPT_NEXT_TABLES = 2,
@@ -524,27 +526,27 @@
OFPTFPT_EXPERIMENTER_MISS = 0xffff,
};
-enum ofp_group_capabilities {
+enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
OFPGFC_SELECT_WEIGHT = 0x1,
OFPGFC_SELECT_LIVENESS = 0x2,
OFPGFC_CHAINING = 0x4,
OFPGFC_CHAINING_CHECKS = 0x8,
};
-enum ofp_queue_properties {
+enum ofp_queue_properties(wire_type=uint16_t) {
OFPQT_MIN_RATE = 0x1,
OFPQT_MAX_RATE = 0x2,
OFPQT_EXPERIMENTER = 0xffff,
};
-enum ofp_controller_role {
+enum ofp_controller_role(wire_type=uint32_t) {
OFPCR_ROLE_NOCHANGE = 0,
OFPCR_ROLE_EQUAL = 1,
OFPCR_ROLE_MASTER = 2,
OFPCR_ROLE_SLAVE = 3,
};
-enum ofp_hello_elem_type {
+enum ofp_hello_elem_type(wire_type=uint16_t) {
OFPHET_VERSIONBITMAP = 1,
};