aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua
AgeCommit message (Collapse)AuthorFilesLines
2023-02-19lua: Check for negative lengths when constructing TvbRangeGilbert Ramirez1-0/+4
2023-02-11Docbook: Reorganize our guide directoriesGerald Combs1-3/+3
Move the top-level user-guide.adoc and developer-guide.adoc to their respective source directores. This is in preparation for a future toolchain revamp. Move the wsug_graphics directory to wsug_src/images and wsdg_graphics directory to wsdg_src/images. Copy common_graphics/* to the each images directory and remove common_graphics. We only have five admonition graphics; duplicating them lets us remove some build config overhead. Rename wsluarm.adoc to wsdg_src/wsdg_lua_support.adoc. Remove a dummy file. Tested visually and by enabling `--failure-level=WARN`.
2023-01-11Windows: Fix Release (unused variables)Philipp Dittmann1-1/+2
- ws_assert does not work, because _ASSERT_ENABLED is false and gets optimized - add _U_ to unused variables because of compile flag /W3 - local variables need suppression of warning 4189
2023-01-09wslua: Fix wsluarm defines.Gerald Combs1-24/+24
2023-01-04wslua: Fix the build.Gerald Combs1-2/+2
Fix wireshark\epan\wslua\wslua_proto_field.c(423,29): error C2220: the following warning is treated as an error [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): error C2220: mask = (guint64)wslua_optguint32(L, idx, default_value); [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): error C2220: ^ [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): warning C4244: 'function': conversion from 'guint64' to 'lua_Number', possible loss of data [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): warning C4244: mask = (guint64)wslua_optguint32(L, idx, default_value); [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): warning C4244: ^ [wireshark\build\epan\wslua\wslua.vcxproj] on Windows and wireshark/epan/wslua/wslua_proto_field.c:1462:48: error: format specifies type 'unsigned long' but the argument has type 'guint64' (aka 'unsigned long long') [-Werror,-Wformat] f->vs,f->mask,f->blob); ^~~~~~~ wireshark/wsutil/wmem/wmem_strutl.h:51:56: note: expanded from macro 'ws_strdup_printf' #define ws_strdup_printf(...) wmem_strdup_printf(NULL, __VA_ARGS__) ^~~~~~~~~~~ on macOS.
2023-01-04WSLUA: allow 64 bits bitmask for ProtoField objectsNardi Ivan3-18/+40
Mask might be specified using a (Lua) number, a string or a UInt64 object. It is useful to handle 64 bit bitfields.
2023-01-04lua: ByteArray integer parsing APIsDeveloper Alexander1-0/+413
Adds APIs for parsing different kinds of integer from a lua ByteArray: -16, 32 and 64 bit -singed or unsigned -encoded little endian or big endian
2023-01-04Lua: make evaluate_lua and run_console publicDavid Perry1-6/+8
2023-01-04Support `FT_CHAR` in Lua `TreeItem_add_item_any()`David Perry1-0/+1
Treat a `FT_CHAR` field like a `FT_UINT*` field, the same as Wireshark's `proto_tree_add_item()` does. Closes #18353
2022-12-10wslua_proto: document the init and prefs_changed functions.Guy Harris1-1/+5
Don't just indicate that they exist and are settable, indicate what the *do*. See https://ask.wireshark.org/question/29843/how-to-maintain-a-packetfile-specific-var/.
2022-12-07WSLUA: Add new lua function register_packet_menu()Moshe Kaplan1-0/+87
This adds support to Wireshark for custom context menus for packets, so that when a packet's context menu is opened (e.g., by right-clicking), Wireshark can support doing things like "run a program" or "open a URL" with a field from the packet as a parameter. Note that this is similar to ArcSight's integration commands feature. For example, it could be used like the following: ``` ROBTEX_URL = "https://www.robtex.com/dns-lookup/" local function search_robtex(...) local fields = {...}; for i, field in ipairs( fields ) do if (field.name == 'http.host') then browser_open_url(ROBTEX_URL .. field.value) break end end end register_packet_menu("Search host in Robtex", search_robtex, "http.host"); ``` Fixes issue #14998
2022-11-28dfilter: Return an error object instead of stringJoão Valverde1-4/+4
Return an struct containing error information. This simplifies the interface to more easily provide richer diagnostics in the future. Add an error code besides a human-readable error string to allow checking programmatically for errors in a robust manner. Currently there is only a generic error code, it is expected to increase in the future. Move error location information to the struct. Change callers and implementation to use the new interface.
2022-11-10wslua: init.lua - superuser logic; typeof() call on non-tableChuck Craft1-2/+8
obj.__typeof exists only for "table" objects (see c4f1777a)
2022-10-31addr_resolv: add support for static hostname entriesChuck Craft1-2/+2
Ping #18075
2022-10-07wslua: Add catch-all enum tablesJoão Valverde2-1/+12
2022-10-07wslua: Use wiretap introspectionJoão Valverde4-114/+39
2022-10-07wslua: Use introspection API to generate constantsJoão Valverde3-135/+138
2022-10-04wslua: Support FT_STRINGZPAD in FieldInfoStig Bjørlykke1-1/+2
Add support for FT_STRINGZPAD in FieldInfo.
2022-09-13Clarify dissector description, protocol short name, and protocol ong name.Guy Harris1-2/+2
Rename dissector_handle_get_long_name() and dissector_handle_get_short_name() to dissector_handle_get_protocol_long_name() and dissector_handle_get_protocol_short_name(), to clarify that they fetch names for the protocol that the dissector dissects, not for the dissector *itself*. Leave a deprecated dissector_handle_get_short_name() wrapper, and export dissector_handle_get_protocol_long_name(), as it's now used in some dissectors. Change some calls to dissector_handle_get_description() back to dissector_handle_get_protocol_short_name(), as they appear to be made in order to display a *protocol* name. Rename some methods, variables, enums, and table column names to reflect cases where the dissector description is being used.
2022-09-12Give dissectors a descriptive string.Guy Harris1-1/+1
It defaults to the short name of the protocol dissected by the descriptor, but it's now possible to register a dissector with an explicit description. This is mainly for use in the Decode As UI. It handles the case where the same protocol might have different "Decode As..."-specifiable dissectors for different situations.
2022-09-11wsdg/Lua: no get_range() method - use fieldinfo.rangeChuck Craft1-2/+2
2022-07-24wslua: Rename wslua_util.c to wslua_utility.c.Gerald Combs2-2/+2
Rename wslua_util.c to wslua_utility.c so that our file name has the form "wslua_<lower case lua module name>.c", which is the case for our other modules.
2022-07-22wslua+lrexlib: Fixup our dependencies and paths.Gerald Combs2-5/+13
Add a register_wslua target and have lrexlib depend on it so that declare_wslual.h is generated in the right order. The working directory when we create declare_wslua.h and register_wslua.c is epan/wslua, so there's no need to explicitly set it. Remove an unneeded lrexlib include path.
2022-07-21wslua: Fix more argument definitions.Gerald Combs3-10/+10
2022-07-21wslua: tapinfo - add state to debug info; update wsluarmChuck Craft1-2/+4
Test wth: for _,tap_name in pairs(Listener.list()) do foo1 = Listener.new(tap_name) print (foo1) end
2022-07-20wslua: Capitalize words in our markup.Gerald Combs6-13/+13
Capitalize words in our markup instead of depending on make-wsluarm.pl. Add a single space after "Mode:".
2022-07-19CMake+lrexlib: Another include path fix attempt.Gerald Combs1-1/+1
2022-07-19CMake+lrexlib: Add another include path.Gerald Combs1-0/+1
Include paths will be added until morale improves.
2022-07-19wslua: Fix our argument definitions.Gerald Combs6-167/+167
Make sure our argument definitions match their corresponding function names.
2022-07-18CMake+lrexlib: Fix our include paths.Gerald Combs2-1/+3
Try to fix C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\epan\wslua\lrexlib\pcre2\../../wslua.h(52,1): fatal error C1083: Cannot open include file: 'epan/wslua/declare_wslua.h': No such file or directory [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\epan\wslua\lrexlib\lrexlib.vcxproj] C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\epan\wslua\lrexlib\pcre2\../../wslua.h(52,1): fatal error C1083: #include <epan/wslua/declare_wslua.h> [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\epan\wslua\lrexlib\lrexlib.vcxproj] C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\epan\wslua\lrexlib\pcre2\../../wslua.h(52,1): fatal error C1083: ^ [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\epan\wslua\lrexlib\lrexlib.vcxproj]
2022-07-15pcre2: Fix -Wmissing-prototypesAlexis La Goutte2-2/+6
lpcre2.c:506:13: warning: no previous prototype for function 'luaopen_rex_pcre2' lpcre2_f.c:207:5: warning: no previous prototype for function 'Lpcre2_config' lpcre2_f.c:234:5: warning: no previous prototype for function 'Lpcre2_get_flags'
2022-07-06Rename Logwolf to LograyGerald Combs1-1/+1
Switch to the name "Logray" for the log analyzer. Rays are biological cousins of sharks and more people like the name "Logray" in a completely unscientific survey here. Apologies for any inconvenience this might cause.
2022-06-27Minor Python3 script fixups.Gerald Combs1-1/+1
Make some scripts executable and use the shebang line recommended at https://docs.python.org/3/using/unix.html#miscellaneous
2022-06-27wslua: Port make-init-lua to Python3Gerald Combs4-276/+215
Port the script that creates init.lua to Python3. The generated init.lua removes one newline and adds another, otherwise the output is identical to the Perl version. Ping #18152.
2022-06-27wslua: Port make-taps to Python3Gerald Combs5-295/+431
Port the script that creates taps_wslua.c and taps.txt to Python3. The generated taps_wslua.c has one less newline, otherwise the output is identical to the Perl version. Make the "taps" configuration file an ConfigParser / .ini file. Ping #18152.
2022-06-24Make sure our Python scripts read and write UTF-8.Gerald Combs1-3/+3
Explicitly set "encoding='utf-8'" for each of the files we read and write in make-reg.py and generate_authors.py.
2022-06-24wslua: Port epan/wslua/make-reg.py to Python3Moshe Kaplan4-104/+116
Port the script that creates declare_wslua.h and register_wslua.c to Python3. Ping #18152.
2022-06-22wsdg: escape tick marks after backtick; fix typoChuck Craft5-6/+6
2022-06-20ftypes: Make accessor functions type safeJoão Valverde1-3/+3
2022-06-10tap: Adding flags for tap_packetRoland Knall1-1/+1
This allows flags to be passed by the registering listener to the collection of information
2022-06-02lrexlib: Disable MSVC narrowing warningsJoão Valverde2-0/+16
2022-05-27lrexlib: Disable a warning [-Wshorten-64-to-32]João Valverde1-0/+1
The warning is harmless and we want to keep upstream code as pristine as possible (unless there is a real issue in the code of course) so disable the warning.
2022-05-26lrexlib: Pacify checkAPIsJoão Valverde2-4/+9
2022-05-26Lua: Add lrexlib-pcre2 Lua regex bindingsJoão Valverde10-2/+2081
Add the de facto standard Lua regex API to Wireshark. Upstream code is copied verbatim and the module opened in the "rex" table. This is just a user convenience and developer quality of life improvement over the GRegex Lua API because it has always been possible to load lrexlib-pcre2 as a Lua module from Wireshark.
2022-05-26Lua: Remove on-life-support GRegex bindingsJoão Valverde8-1722/+2
This code has been unmaintained and does not pass the lrexlib test suite. GRegex itself has been obsolescent for some time, although GNOME has recently restarted trying to move it to PCRE2. Remove it in preparation for a move to lrexlib-pcre2.
2022-05-16wsdg/lua: gui.colorized_frame.fg example is a few digits shortChuck Craft1-1/+1
2022-04-25wslua: another fix for -Werror=clobberedPeter Lemenkov1-1/+1
``` cd /home/petro/work/wireshark/epan/wslua && /usr/bin/cc -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DWS_BUILD_DLL -I/home/petro/work/wireshark -I/home/petro/work/wireshark/include -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /usr/include/lua-5.1 -isystem /home/petro/work/wireshark/epan/wslua -fvisibility=hidden -fexcess-precision=fast -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wredundant-decls -Wno-error=maybe-uninitialized -Wno-format-truncation -Wframe-larger-than=32768 -Wunused-const-variable -Wshadow -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Wjump-misses-init -Werror=implicit -Wno-pointer-sign -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fmacro-prefix-map=/home/petro/work/wireshark/= -fmacro-prefix-map=/home/petro/work/wireshark/= -O2 -g -DNDEBUG -fPIC -std=gnu11 -Werror -MD -MT epan/wslua/CMakeFiles/wslua.dir/init_wslua.c.o -MF CMakeFiles/wslua.dir/init_wslua.c.o.d -o CMakeFiles/wslua.dir/init_wslua.c.o -c /home/petro/work/wireshark/epan/wslua/init_wslua.c /home/petro/work/wireshark/epan/wslua/wslua_tree.c: In function ‘TreeItem_add_packet_field’: /home/petro/work/wireshark/epan/wslua/wslua_tree.c:79:17: error: variable ‘item’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] 79 | proto_item* item = NULL; | ^~~~ Consolidate compiler generated dependencies of target dissectors cc1: all warnings being treated as errors make[2]: *** [epan/wslua/CMakeFiles/wslua.dir/build.make:508: epan/wslua/CMakeFiles/wslua.dir/wslua_tree.c.o] Error 1 make[2]: *** Waiting for unfinished jobs.... ``` Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2022-04-15wslua: Update the menu group documentation.Gerald Combs1-15/+33
Update to match ca04f4c8cb.
2022-04-12Qt: Update our dynamic menu groups.Gerald Combs2-4/+14
Add log-specific statistics groups, and use them to limit the dynamic menu items in Wireshark and Logwolf.
2022-03-25wslua: Lua Console - add Clear button; restore print()Chuck Craft1-1/+2