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/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,