Dissect OXM list
diff --git a/wireshark_gen/templates/_ofreader.lua b/wireshark_gen/templates/_ofreader.lua
index b25f7c8..a4c57be 100644
--- a/wireshark_gen/templates/_ofreader.lua
+++ b/wireshark_gen/templates/_ofreader.lua
@@ -64,5 +64,9 @@
return r
end
+ self.skip_align = function()
+ offset = math.floor((offset + 7)/8)*8
+ end
+
return self
end
diff --git a/wireshark_gen/templates/_oftype_readers.lua b/wireshark_gen/templates/_oftype_readers.lua
index fb6eb6f..a6a76ce 100644
--- a/wireshark_gen/templates/_oftype_readers.lua
+++ b/wireshark_gen/templates/_oftype_readers.lua
@@ -123,3 +123,20 @@
function read_list_of_packet_queue_t(reader, version, subtree, field_name)
-- TODO
end
+
+function read_list_of_oxm_t(reader, version, subtree, field_name)
+ if reader.is_empty() then
+ return
+ end
+ local list_len = reader.peek(-2,2):uint()
+ local reader2 = reader.slice(list_len - 4)
+ local list = subtree:add(fields[field_name], reader2.peek_all(0))
+ while not reader2.is_empty() do
+ local match_len = 4 + reader2.peek(3,1):uint()
+ local child_reader = reader2.slice(match_len)
+ local child_subtree = list:add(fields[field_name], child_reader.peek_all(0))
+ local info = dissect_of_oxm_v3(child_reader, child_subtree)
+ child_subtree:set_text(info)
+ end
+ reader.skip_align()
+end
diff --git a/wireshark_gen/templates/openflow.lua b/wireshark_gen/templates/openflow.lua
index b443463..bf1cdf5 100644
--- a/wireshark_gen/templates/openflow.lua
+++ b/wireshark_gen/templates/openflow.lua
@@ -150,6 +150,16 @@
return protocol, info
end
+function dissect_of_oxm_v3(reader, subtree)
+ local type_val = reader.peek(0,4):uint()
+
+ local info = "unknown"
+ if of_oxm_v3_dissectors[type_val] then
+ info = of_oxm_v3_dissectors[type_val](reader, subtree)
+ end
+
+ return info
+end
-- of dissector function
function p_of.dissector (buf, pkt, root)
local offset = 0