wireshark: read actions list
diff --git a/wireshark_gen/templates/_ofreader.lua b/wireshark_gen/templates/_ofreader.lua
index 2ec160d..b25f7c8 100644
--- a/wireshark_gen/templates/_ofreader.lua
+++ b/wireshark_gen/templates/_ofreader.lua
@@ -46,6 +46,10 @@
return buf(offset + off, len)
end
+ self.peek_all = function(off)
+ return buf(offset + off, buf:len() - offset - off)
+ end
+
self.skip = function(len)
offset = offset + len
end
diff --git a/wireshark_gen/templates/_oftype_readers.lua b/wireshark_gen/templates/_oftype_readers.lua
index 133d70f..c12d85b 100644
--- a/wireshark_gen/templates/_oftype_readers.lua
+++ b/wireshark_gen/templates/_oftype_readers.lua
@@ -102,7 +102,18 @@
end
function read_list_of_action_t(reader, version, subtree, field_name)
- -- TODO
+ if reader.is_empty() then
+ return
+ end
+
+ local list = subtree:add(fields[field_name], reader.peek_all(0))
+ while not reader.is_empty() do
+ local action_type = reader.peek(0, 2):uint()
+ local action_len = reader.peek(2, 2):uint()
+ local child_reader = reader.slice(action_len)
+ local child_subtree = list:add(fields[field_name], child_reader.peek_all(0))
+ local info = dissect_of_action_v1(child_reader, child_subtree)
+ end
end
function read_list_of_port_desc_t(reader, version, subtree, field_name)