From 860747e1e78aefdaf31e77408ad590b9d759d1aa Mon Sep 17 00:00:00 2001 From: Hadriel Kaplan Date: Tue, 18 Feb 2014 10:03:04 -0500 Subject: Adds some Lua helper functions: some commonly used functions, and to help troubleshooting Lua scripts There are some common things people need to do, such as convert to/from hex or get the raw binary string in a ByteArray/Tvb/TvbRange. These have been added, as well as some tests for them in the testsuites. Also, functions have been added to allow a script to get all the available tap types and filter fields, since they are not exactly what one can see in the Wireshark gui. Change-Id: I92e5e4eae713bb90d79b0c024eaa4e55b99cc96b Reviewed-on: https://code.wireshark.org/review/249 Reviewed-by: Alexis La Goutte --- epan/tap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'epan/tap.c') diff --git a/epan/tap.c b/epan/tap.c index f4036afdb6..564254802b 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -421,7 +421,21 @@ draw_tap_listeners(gboolean draw_all) } } +/* Gets a GList of the tap names. The content of the list + is owned by the tap table and should not be modified or freed. + Use g_list_free() when done using the list. */ +GList* +get_tap_names() +{ + GList *list = NULL; + tap_dissector_t *td; + for(td=tap_dissector_list; td; td=td->next) { + list = g_list_prepend(list, td->name); + } + + return g_list_reverse(list); +} /* ********************************************************************** * Functions used by tap to -- cgit v1.2.1