Wireshark-commits: [Wireshark-commits] master 66719c9: Add way for Lua file reader to save state pe
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=66719c9b6a17f15848f4e7151b0f6cbf9d37f9ed
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
66719c9 by Hadriel Kaplan (hadrielk@xxxxxxxxx):
Add way for Lua file reader to save state per file read/write ops
Lua can create a file reader/writer, to open new capture file
formats or write to new ones. To save local state, it can save
things in Lua itself; but since there can be multiple open files
at the same time (for example during a reload), the Lua script
won't know for which file and state its read/write functions are
being invoked for. To remedy this, and also provide a convenient
way to store such state, this commit adds the ability for a Lua
script to store a Lua table in the wtap/wtap_dumper's priv
data member, just like C-code-based reader/writers do.
Change-Id: Ifc9e0d5f0379accee56f2a04b6080238670fec52
Reviewed-on: https://code.wireshark.org/review/766
Reviewed-by: Hadriel Kaplan <hadrielk@xxxxxxxxx>
Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
Actions performed:
from 296bc0b Fix Bug 9909 Buildbot crash correctly
adds 66719c9 Add way for Lua file reader to save state per file read/write ops
Summary of changes:
epan/wslua/wslua_file.c | 302 +++++++++++++++++++++++++++--
test/lua/acme_file.lua | 305 ++++++++++++++++++------------
test/lua/pcap_file.lua | 482 +++++++++++++++++++++++++++++++++--------------
test/suite-wslua.sh | 2 +
4 files changed, 811 insertions(+), 280 deletions(-)