get_config_reply|set_config: fix enum, support java
diff --git a/java_gen/java_model.py b/java_gen/java_model.py
index cfece7d..f90c1f2 100644
--- a/java_gen/java_model.py
+++ b/java_gen/java_model.py
@@ -93,6 +93,12 @@
OFTableConfig = (
MaskedEnumGroup("table_miss_flags", mask="TABLE_MISS_MASK", members=set(("TABLE_MISS_CONTROLLER", "TABLE_MISS_CONTINUE", "TABLE_MISS_DROP"))),
),
+ OFGetConfigReply = (
+ MaskedEnumGroup("flags", mask="OFP_FRAG_MASK", members=set(("FRAG_NORMAL", "FRAG_DROP", "FRAG_REASM"))),
+ ),
+ OFSetConfig = (
+ MaskedEnumGroup("flags", mask="OFP_FRAG_MASK", members=set(("FRAG_NORMAL", "FRAG_DROP", "FRAG_REASM"))),
+ ),
)
# represents a metadata property associated with an EnumClass
diff --git a/openflow_input/standard-1.0 b/openflow_input/standard-1.0
index ad2e76f..1df03bb 100644
--- a/openflow_input/standard-1.0
+++ b/openflow_input/standard-1.0
@@ -190,7 +190,7 @@
OFPC_ARP_MATCH_IP = 0x80,
};
-enum ofp_config_flags(wire_type=uint32_t, bitmask=True) {
+enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
OFPC_FRAG_NORMAL = 0x0,
OFPC_FRAG_DROP = 0x1,
OFPC_FRAG_REASM = 0x2,
@@ -371,7 +371,7 @@
uint8_t type == 8;
uint16_t length;
uint32_t xid;
- uint16_t flags;
+ enum ofp_config_flags flags;
uint16_t miss_send_len;
};
@@ -380,7 +380,7 @@
uint8_t type == 9;
uint16_t length;
uint32_t xid;
- uint16_t flags;
+ enum ofp_config_flags flags;
uint16_t miss_send_len;
};
diff --git a/openflow_input/standard-1.1 b/openflow_input/standard-1.1
index 7dedae7..a9aac6b 100644
--- a/openflow_input/standard-1.1
+++ b/openflow_input/standard-1.1
@@ -477,7 +477,7 @@
uint8_t type == 8;
uint16_t length;
uint32_t xid;
- uint16_t flags;
+ enum ofp_config_flags flags;
uint16_t miss_send_len;
};
@@ -486,7 +486,7 @@
uint8_t type == 9;
uint16_t length;
uint32_t xid;
- uint16_t flags;
+ enum ofp_config_flags flags;
uint16_t miss_send_len;
};
diff --git a/openflow_input/standard-1.2 b/openflow_input/standard-1.2
index 8f21594..c1e8a2b 100644
--- a/openflow_input/standard-1.2
+++ b/openflow_input/standard-1.2
@@ -515,7 +515,7 @@
uint8_t type == 8;
uint16_t length;
uint32_t xid;
- uint16_t flags;
+ enum ofp_config_flags flags;
uint16_t miss_send_len;
};
@@ -524,7 +524,7 @@
uint8_t type == 9;
uint16_t length;
uint32_t xid;
- uint16_t flags;
+ enum ofp_config_flags flags;
uint16_t miss_send_len;
};
diff --git a/openflow_input/standard-1.3 b/openflow_input/standard-1.3
index 1518931..87adcc4 100644
--- a/openflow_input/standard-1.3
+++ b/openflow_input/standard-1.3
@@ -648,7 +648,7 @@
uint8_t type == 8;
uint16_t length;
uint32_t xid;
- uint16_t flags;
+ enum ofp_config_flags flags;
uint16_t miss_send_len;
};
@@ -657,7 +657,7 @@
uint8_t type == 9;
uint16_t length;
uint32_t xid;
- uint16_t flags;
+ enum ofp_config_flags flags;
uint16_t miss_send_len;
};
diff --git a/test_data/of13/get_config_reply.data b/test_data/of13/get_config_reply.data
index 111ac61..66ea834 100644
--- a/test_data/of13/get_config_reply.data
+++ b/test_data/of13/get_config_reply.data
@@ -9,3 +9,8 @@
xid=0x12345678,
flags=ofp.OFPC_FRAG_REASM,
miss_send_len=0xffff)
+-- java
+builder.setXid(0x12345678)
+ .setFlags(Sets.immutableEnumSet(OFConfigFlags.FRAG_REASM))
+ .setMissSendLen(0xffff)
+ .build()