Merge branch 'master' of github.com:floodlight/loxigen into group_mod
Conflicts:
java_gen/java_model.py
loxi_front_end/frontend.py
loxi_front_end/frontend_ir.py
loxigen.py
py_gen/templates/message.py
utest/test_frontend.py
diff --git a/py_gen/templates/message.py b/py_gen/templates/message.py
index 23f28dc..39e9722 100644
--- a/py_gen/templates/message.py
+++ b/py_gen/templates/message.py
@@ -177,6 +177,30 @@
else:
raise loxi.ProtocolError("unexpected stats type %u" % stats_type)
+def parse_experimenter_stats_request(buf):
+ if len(buf) < 24:
+ raise loxi.ProtocolError("experimenter stats request message too short")
+
+ experimenter, exp_type = struct.unpack_from("!LL", buf, 16)
+
+ if experimenter in experimenter_stats_request_parsers and \
+ exp_type in experimenter_stats_request_parsers[experimenter]:
+ return experimenter_stats_request_parsers[experimenter][exp_type](buf)
+ else:
+ raise loxi.ProtocolError("unexpected stats request experimenter %#x exp_type %#x" % (experimenter, exp_type))
+
+def parse_experimenter_stats_reply(buf):
+ if len(buf) < 24:
+ raise loxi.ProtocolError("experimenter stats reply message too short")
+
+ experimenter, exp_type = struct.unpack_from("!LL", buf, 16)
+
+ if experimenter in experimenter_stats_reply_parsers and \
+ exp_type in experimenter_stats_reply_parsers[experimenter]:
+ return experimenter_stats_reply_parsers[experimenter][exp_type](buf)
+ else:
+ raise loxi.ProtocolError("unexpected stats reply experimenter %#x exp_type %#x" % (experimenter, exp_type))
+
def parse_experimenter(buf):
if len(buf) < 16:
raise loxi.ProtocolError("experimenter message too short")
@@ -255,6 +279,7 @@
const.OFPST_TABLE : table_stats_reply.unpack,
const.OFPST_PORT : port_stats_reply.unpack,
const.OFPST_QUEUE : queue_stats_reply.unpack,
+ const.OFPST_EXPERIMENTER : parse_experimenter_stats_reply,
:: if version >= OFVersions.VERSION_1_1:
const.OFPST_GROUP : group_stats_reply.unpack,
const.OFPST_GROUP_DESC : group_desc_stats_reply.unpack,
@@ -278,6 +303,7 @@
const.OFPST_TABLE : table_stats_request.unpack,
const.OFPST_PORT : port_stats_request.unpack,
const.OFPST_QUEUE : queue_stats_request.unpack,
+ const.OFPST_EXPERIMENTER : parse_experimenter_stats_request,
:: if version >= OFVersions.VERSION_1_1:
const.OFPST_GROUP : group_stats_request.unpack,
const.OFPST_GROUP_DESC : group_desc_stats_request.unpack,
@@ -307,3 +333,19 @@
},
:: #endfor
}
+
+experimenter_stats_request_parsers = {
+ 0x005c16c7: {
+:: if version >= OFVersions.VERSION_1_3:
+ 1: bsn_lacp_stats_request.unpack,
+:: #endif
+ },
+}
+
+experimenter_stats_reply_parsers = {
+ 0x005c16c7: {
+:: if version >= OFVersions.VERSION_1_3:
+ 1: bsn_lacp_stats_reply.unpack,
+:: #endif
+ },
+}