aboutsummaryrefslogtreecommitdiffstats
path: root/test/lua
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-05-24 11:28:30 -0700
committerGuy Harris <guy@alum.mit.edu>2014-05-24 18:31:25 +0000
commit6db77b000fe58173eeed23b91b32c92c681feda2 (patch)
tree5113821a7f5e1b43734eccf94783d37962b37712 /test/lua
parent33ae4cb024e36192ff7c6fa1d3d6bdcce9b25b7a (diff)
Allow wtap_read() and wtap_seek_read() to return records other than packets.
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be REC_TYPE_PACKET, for a record containing a packet, or REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific data. Modify code that reads packets to be able to handle non-packet records, even if that just means ignoring them. Rename some routines to indicate that they handle more than just packets. We don't yet have any libwiretap code that supplies records other than REC_TYPE_PACKET or that supporting writing records other than REC_TYPE_PACKET, or any code to support plugins for handling REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug 8590. Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813 Reviewed-on: https://code.wireshark.org/review/1773 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'test/lua')
-rw-r--r--test/lua/acme_file.lua1
-rw-r--r--test/lua/pcap_file.lua6
2 files changed, 5 insertions, 2 deletions
diff --git a/test/lua/acme_file.lua b/test/lua/acme_file.lua
index f00f25f0cb..30c328288f 100644
--- a/test/lua/acme_file.lua
+++ b/test/lua/acme_file.lua
@@ -656,6 +656,7 @@ end
function Packet:set_wslua_fields(frame)
frame.time = self.timestamp
+ frame.rec_type = wtap_rec_types.PACKET
frame.flags = wtap_presence_flags.TS -- for timestamp
if self.comment then
frame.comment = self.comment
diff --git a/test/lua/pcap_file.lua b/test/lua/pcap_file.lua
index 9f42f9700b..d15b648ce4 100644
--- a/test/lua/pcap_file.lua
+++ b/test/lua/pcap_file.lua
@@ -8,7 +8,7 @@
be as good as the real thing; this is a simplistic implementation to show how to
create such file readers, and for testing purposes.
- This script requires Wireshark v1.11.3 or newer.
+ This script requires Wireshark v1.12 or newer.
--]]
--------------------------------------------------------------------------------
@@ -33,7 +33,7 @@ end
local major, minor, micro = get_version():match("(%d+)%.(%d+)%.(%d+)")
if major and tonumber(major) <= 1 and ((tonumber(minor) <= 10) or (tonumber(minor) == 11 and tonumber(micro) < 3)) then
error( "Sorry, but your " .. wireshark_name .. " version (" .. get_version() .. ") is too old for this script!\n" ..
- "This script needs " .. wireshark_name .. "version 1.11.3 or higher.\n" )
+ "This script needs " .. wireshark_name .. "version 1.12 or higher.\n" )
end
-- verify we have the Struct library in wireshark
@@ -576,6 +576,8 @@ parse_rec_header = function(funcname, file, file_settings, frame)
caplen = WTAP_MAX_PACKET_SIZE
end
+ frame.rec_type = wtap_rec_types.PACKET
+
frame.captured_length = caplen
frame.original_length = origlen