Wireshark-commits: [Wireshark-commits] master bd36fe1: Fix bug 6357: Lua all_field_infos() broken w

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 25 Feb 2014 21:06:52 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=bd36fe1bcbe19dd1b63836cc60d7351d7d8b4aa8
Submitter: Alexis La Goutte (alexis.lagoutte@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

bd36fe1 by Hadriel Kaplan (hadrielk@xxxxxxxxx):

    Fix bug 6357: Lua all_field_infos() broken within tap/listener
    
    The current API for Lua provides a global function
    "all_field_infos()" which returns all the populated field_info nodes
    in the current proto_tree.
    
    By default all_field_infos() "works", in the literal sense: it returns
    exactly the fields the previous dissectors of the packet have
    populated at that instant of time.  But of course dissectors don't
    populate all the applicable fields most of the time, because of the
    TRY_TO_FAKE_THIS_ITEM optimization where they don't fill in things
    that aren't needed at the time by a display, color, or tap's dfilter.
    
    So this commit offers a way to force the dissectors to populate
    all the applicable field_infos in the tree, by setting the proto_tree
    to be visible.  Obviously that is going to impact performance, since
    it basically bypasses the TRY_TO_FAKE_THIS_ITEM optimization; so the
    patch only does this if the Lua script author told it to explicitly,
    by adding an argument to Listener.new() and register_postdissector().
    
    Change-Id: I11d3559fbe8c14fbadf1b51415a3701dc1200b7b
    Reviewed-on: https://code.wireshark.org/review/286
    Reviewed-by: Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>
    

Actions performed:

    from  860747e   Adds some Lua helper functions: some commonly used functions, and to help troubleshooting Lua scripts
    adds  bd36fe1   Fix bug 6357: Lua all_field_infos() broken within tap/listener


Summary of changes:
 epan/epan.c                 |   17 +++++++++-
 epan/epan.h                 |   12 +++++++
 epan/wslua/wslua.h          |    1 +
 epan/wslua/wslua_listener.c |   12 +++++++
 epan/wslua/wslua_proto.c    |   10 ++++--
 test/lua/listener.lua       |   73 +++++++++++++++++++++++++++++++++++++++++--
 6 files changed, 118 insertions(+), 7 deletions(-)