This enables a Lua script to implement a brand new capture file format reader/writer, so that for example one could write a script to read from vendor-specific "logs" of packets, and show them as normal packets in wireshark.
Change-Id: Id394edfffa94529f39789844c382b7ab6cc2d814
Reviewed-on: https://code.wireshark.org/review/431
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
While Lua's built-in pattern support is ok for simple things, many people end
up wanting a real regex engine. Since Wireshark already includes the GLib
Regex library (a wrapper for PCRE), it makes sense to expose that library to
Lua scripts. This has been done using Lrexlib, one of the most popular regex
bindings for Lua. Lrexlib didn't support binding GLib's Regex in particular -
it does for PCRE but GLib is a different API - so I've done that. A fairly
thorough testsuite came along with that, which has been incorporated into the
wireshark wslua testuites as well in this commit.
Change-Id: I05811d1edf7af8d7c9f4f081de6850f31c0717c7
Reviewed-on: https://code.wireshark.org/review/332
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Over time the various wslua classes/functions have gotten moldy, with different
ways of doing similar things. Some of it can't be changed without breaking
backwards compatibility for Lua scripts, so I didn't do that. But I did what
I could. The biggest change is a refactoring of how accessors/attributes
are handled in the code, so that most of them work the same way using the
same code.
Specific changes made:
* Added null/expired checking macro to class declarations for many classes
* Removed extraneous pointer/expired checking, since checkFoo() does that already
* Fixed "errors" reported by clang static analyzer; they were false positives, but it was easier to get it to stop complaining by changing the code
* Moved internal wslua functions from wslua_utils.c into a new 'wslua_internals.c' file
* Changed Listener/NSTime/Pinfo/Proto to use a common setter/getter accessor/attribute code model, instead of each of them doing their own
* Fixed some API doc mistakes, mostly around attributes that were documented as read-only but were actually read-write
Change-Id: Idddafc5fbd3545ebff29e063acc767e1c743a1a9
Reviewed-on: https://code.wireshark.org/review/271
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
This is based on Roberto Ierusalimschy's struct library, along with additional
options based on Flemming Madsen's patch to the lua-users mailing list, and
some changes I made to support 64-bit integer packing/unpacking. Details
are in the top comments for wslua_struct.c. This also includes a test script.
Change-Id: Ifcd0116ba013d5c760927721c8d6e9f28965534b
Reviewed-on: https://code.wireshark.org/review/98
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
usefulness, working around bug #9162 until Lua 5.3 is released.
The existing Int64 and UInt64 classes provide virtually no
usefullness, other than for creating a string of their value. While
one could then write Lua code to convert the string to Lua numbers and
such, ultimately Lua has no native 64-bit integer support, making such
a task difficult to handle in Lua. This change adds a host of
functions and operators to the existing Int64 (gint64) and UInt64
(guint64) classes, to enable true 64-bit integer support on par with
native Lua numbers.
A test script is also provided, which tests the functions/operators.
Change-Id: I4c5f8f5219b9a88198902283bd32ddf24c346bbe
Reviewed-on: https://code.wireshark.org/review/83
Tested-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
declares the functions must be included, in order to make sure the
declarations match the function signature. Make it so - which means
creating the header file in the first place.
That means luaopen_bit() doesn't need to, and shouldn't be, declared in
wslua.h.
Have make-reg.pl generate a #include of lua_bitop.h. Also fix the "this
is autogenerated" warning.
svn path=/trunk/; revision=54725
from makefiles (and thus from the buildbot).
The intention is to be able to tell when a human is running the tool so we
can provide more code-review guidance.
As a starter, enable the "too many proto_tree_add_text() calls" check when
a human is running the tool.
svn path=/trunk/; revision=41943
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4788
- Compile the python code directly into epan - don't link it in as
a static lib.
- Call make-init-lua.pl with the top level directory instead of the
current directory. Change make-init-lua.pl accordingly.
svn path=/trunk/; revision=33009
correct example and documentation about register_menu()
my own: do not fail to make init.lua when building in a different dir
svn path=/trunk/; revision=24879
Don't put $(srcdir)/ at the beginning of those file names - other
Makefile.am files don't have it, and it appears to break "make
distcheck", at least on my Mac OS X 10.4 machine.
svn path=/trunk/; revision=22439
(Temporarily disable the warnings as errors default on Unix to get
to get the buildbots and people with gcc40 going again until those
additional warnings gcc40 generates can be fixed-I'm working on it
ASAP)
Patch for configure.in which disables by default the treatment of
warnings as errors.
It can be enabled with './configure --with-warnings-as-errors'.
The macro will test first if GCC is present. If it's the case,
HAVE_WARNINGS_AS_ERRORS is defined. All the USING_GCC have been replaced
by HAVE_WARNINGS_AS_ERRORS.
With this switch, people won't suffer from unexpected warnings when
downloading svn sources during the transition time ;)
svn path=/trunk/; revision=21153
add sccp_info to struct _packet_info (Sorry but the way private_data works and the fact that TCAP uses it and BSSAP/RANAP can be tunnelled on GSMMAP over TCAP makes it impossible to avoid)
SCCP
- Have SCCP to have a TAP,
- Fix associations so that every message belongs to the association.
- Export message type values so that they can be used by a tap listener
RANAP
- Have RANAP information attached to the sccp_info
BSSAP + GSM_A
- Have DTAP, BSSMAP and BSSAP info attached to the sccp_info
svn path=/trunk/; revision=21076
Add more documentation to the code.
change make-dco.pl so that it creates more readable docbook output.
This should be copied over to 0.99.4
svn path=/trunk/; revision=19670
- remove data_ref where it is not used anymore (callbacks won't pass userdata as this ius better done using lua's closures)
- have TextWindow:set_editable() using its argument
- add wslua_optbool(L,n,d) to pull an optional boolean from the stack
- several fixes to docbook generation (now it compiles!)
svn path=/trunk/; revision=19608
- do not #include a c code file in wslua_register.c compile a separate boject
- add the console and evaluate windows
- add some useful vars to the lua environment
- some cleanup
- add the dtd generator code (currently disabled)
svn path=/trunk/; revision=19579
- wslua_field.c: avoid FieldInfo:__tostring() crashing when the ftype has no val_to_string_repr
- init.lua: inform the user that a packet has been disabled, intead of a cryptic "attemt to call nil"
- Makefile.am: add register_wslua.c and declare_wslua.h to MAINTAINERCLEANFILES
- wslua_gui.c: fix a typo
svn path=/trunk/; revision=19425
ERROR: files left in build directory after distclean:
./epan/wslua/declare_wslua.h
./epan/wslua/register_wslua.c
Louis, could you have a look - I might have produced a mess :-)
svn path=/trunk/; revision=19423