Age | Commit message (Collapse) | Author | Files | Lines |
|
Replace proto_tree_add_text() calls in Lua API code, to use Lua-specific hfinfo items.
Bug: 10828
Change-Id: I9b5899106502a9bdbc748b5ec0f27b787d374562
Reviewed-on: https://code.wireshark.org/review/6296
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
|
|
Also, convert the "string" hf_ entries that used tvb_fcwwn_to_str as a string to use proto_tree_add_item with FT_FCWWN type.
Change-Id: I4ca77870499fd8239584a70874998b5d194a7167
Reviewed-on: https://code.wireshark.org/review/6036
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
|
|
Move it to the Developer's Guide while we're here.
Nudge the markup in epan/wslua where needed. Note that we should
probably convert it to AsciiDoc (if we're going to keep it in the DG) or
Doxygen.
Change-Id: Ie175111043f98b7a37eeeb8d185a833d8e866f8b
Reviewed-on: https://code.wireshark.org/review/5203
Reviewed-by: Gerald Combs <gerald@wireshark.org>
|
|
The protofield is optional and can not be replaced with 'nil'
as with the other fields for this function.
Change-Id: I2b1dd7f290264394b400cea2110b65b657c71456
Reviewed-on: https://code.wireshark.org/review/4549
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
|
|
This commit adds tvb_get_string_bytes and proto_tree_add_bytes_item routines for
getting GByteArrays fields from the tvb when they are encoded in ASCII hex string form.
The proto_tree_add_bytes_item routine is also usable for normal
binary encoded byte arrays, and has the advantage of retrieving
the array values even if there's no proto tree.
It also exposes the routines to Lua, both so that a Lua script can take
advantage of this, but also so I can write a testsuite to test the functions.
Change-Id: I112a038653df6482a5d0ebe7c95708f207319e20
Reviewed-on: https://code.wireshark.org/review/1158
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
from gcc 4.9.
Change-Id: I8495d746f47c0e2528f88295771f86197d22d159
Reviewed-on: https://code.wireshark.org/review/1166
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
|
|
Change-Id: I9e60fd8a8353e740c1b57f52daac86b1af1b784f
Reviewed-on: https://code.wireshark.org/review/1106
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
|
|
../../../epan/wslua/wslua_tree.c: In function 'TreeItem_add_packet_field':
../../../epan/wslua/wslua_tree.c:151:14: error: variable 'tvbr' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
../../../epan/wslua/wslua_tree.c:154:9: error: variable 'ett' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
../../../epan/wslua/wslua_tree.c:159:9: error: variable 'nargs' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
Change-Id: I1720a62613f4bf94ae2f8649a04139a7899fb106
Reviewed-on: https://code.wireshark.org/review/1103
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
This commit adds tvb_get_string_time and proto_tree_add_time_item routines for
getting nstime fields from the tvb when they are encoded in ASCII string form.
The proto_tree_add_time_item routine is also usable for normal
big/little-endian encoded time_t, and has the advantage of retrieving
the value even if there's no proto tree.
It also exposes the routines to Lua, both so that a Lua script can take
advantage of this, but also so I can write a testsuite to test the functions.
Change-Id: I955da10f68f2680e3da3a5be5ad8fdce7ed6808c
Reviewed-on: https://code.wireshark.org/review/1084
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
errors.
A common Lua idiom is to use chained calls, i.e. tree:foo():bar():choo(). This actually
works for tree:add() because it returns the new child tree item which is then the one
being applied to the next chained call. But it doesn't work beyond that for things like
set_generated() and so on. So this commit fixes that.
This also fixes the Lua tree:add() function for the FT_BOOL type to let it be a Lua boolean value.
And it reverts a previous change to Struct.tohex() to allow coercion of the argument.
Change-Id: I10f819d363163914ba320c87d4bedebe5b50cacf
Reviewed-on: https://code.wireshark.org/review/851
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
This adds the ability for a Lua script to register expert info fields,
similar to C-code dissectors. This change also removes the need for
the expert_add_info_format_internal() function. Existing Lua scripts
do not have to change, because the existing expert info function
uses the internal "_ws.lua" protocol instead of nothing; but using
the new functionality provides more benefits since it correctly
registers the expert info fields to the dissector's protocol.
The test suite was amended to generate both old and new forms.
Change-Id: Ib5ae74e927cfa81312baf7b04ff4104b0b4f936e
Reviewed-on: https://code.wireshark.org/review/830
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
This enhances the Lua API doc generator Perl script to handle
meta-information in description comments, such as bold, italics,
raw code, version info, etc.
The supported markup and codes are documented in make-wsluarm.pl.
It's not beautiful Perl code (I don't know Perl), and I'd rather
do it using Lua, but I think keeping it Perl makes more sense in
the long run.
Change-Id: I477b3ebe770075dcea9ec52708e2d6fb5758d2f4
Reviewed-on: https://code.wireshark.org/review/802
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')
Fix manually some typo (in export_object_dicom.c and crc16-plain.c)
Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
|
|
This fixes/addresses all the coverity warnings shown by
the buildbots. (I hope)
Change-Id: Ic2722df97c577d274e3cf3f0cbdca1902edde047
Reviewed-on: https://code.wireshark.org/review/423
Reviewed-by: Gerald Combs <gerald@wireshark.org>
|
|
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.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>
|
|
but was supposed to be'
Similar to bug 9725 and ProtoField.new(), the way the VALUESTRING argument is being checked
in the code for ProtoField.bool() ends up making it non-optional. This patch fixes that,
along with some minor API documentation fixes (text).
Change-Id: Iadb9a8ace9c5514fc623d882301fe16b637fe4ce
Reviewed-on: https://code.wireshark.org/review/125
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@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>
|
|
Change-Id: I689319c0071fdb42583e8bd7633d8f0660c92f1b
Reviewed-on: https://code.wireshark.org/review/51
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
|
|
svn path=/trunk/; revision=54796
|
|
with FT_BYTES to now use FT_SYSTEM_ID type.
svn path=/trunk/; revision=54383
|
|
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9192)
From Ed Beroset.
svn path=/trunk/; revision=52393
|
|
svn path=/trunk/; revision=52000
|
|
svn path=/trunk/; revision=51924
|
|
LUA API filterable (suggestions welcome!), but I wanted to start forcing dissectors to use the filterable expert API (nothing like compile errors to force change!). I created expert_add_info_format_internal (original expert_add_info_format) and used it as a placeholder for proto.c/LUA API until a solution is created. The "new" expert_add_info_format will be the "old" expert_add_info_format_text, and I'll slowly do the search/replace.
For those with dissectors outside the source tree, please see tools/convert_expert_add_info_format.pl for help with the conversion. Please do not use expert_add_info_format_internal, as it's support time will be very short lived.
svn path=/trunk/; revision=51844
|
|
svn path=/trunk/; revision=51144
|
|
remove C++ incompatibilities
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416
svn path=/trunk/; revision=48337
|
|
From Hadriel Kaplan, bug 8393 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8393)
svn path=/trunk/; revision=47885
|
|
svn path=/trunk/; revision=45016
|
|
(COPYING will be updated in next commit)
svn path=/trunk/; revision=43536
|
|
Update Lua from 5.1 to 5.2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7400
svn path=/trunk/; revision=43479
|
|
svn path=/trunk/; revision=43116
|
|
svn path=/trunk/; revision=42622
|
|
proto_tree_add_item() calls.
Add new "add_packet_field" method to the TreeItem class, taking a
protocol field (*not* a protocol), TvbRange, and encoding value as
arguments.
Add the ENC_ values to init.lua. Make them all hex #defines so
make-init-lua.pl can easily extract them.
Export tvb_unicode_strsize() for use by Lua (and elsewhere as desired).
Note that it handles UTF-16 and UTF-8, and fix the comment to note that
its count of hexadectets *does* include the null terminator (that's what
the code does).
svn path=/trunk/; revision=42621
|
|
This object can be used to retreive other absolute and relative time fields,
create and modify nstime_t values and put generated time values in the tree.
Also added ProtoField.absolute_time and ProtoField.relative_time.
svn path=/trunk/; revision=38616
|
|
This avoids a warning building epan.c which includes both config.h and wslua.h
(duplicate defines from config.h)
svn path=/trunk/; revision=36751
|
|
34598 and 34599.
svn path=/trunk/; revision=34602
|
|
Pull function names to column 0 - except when necessary for autoregistration.
Put function comments before the function.
For readability, put the macros for functions before the function too.
Put class functions before the class.
svn path=/trunk/; revision=34599
|
|
WSLUA improvement.
The existing ProtoField.bool looks like the following:
ProtoField.bool(abbr, [name], [desc])
But checking any protocol dissector with bool protofield, it can be seen that
in C code we have more options than thru the WSLUA interface.
E.g.: {&hf_gtp_qos_sig_ind,{"Signalling Indication", "gtp.sig_ind", FT_BOOLEAN,
8, TFS(>p_sig_ind), GTP_EXT_QOS_SIG_IND_MASK, NULL, HFILL}},
So I've extended ProtoField.bool to have more options like this:
ProtoField.bool(abbr, [name], [bitfield], [true_false_string], [mask], [desc])
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4700
svn path=/trunk/; revision=32771
|
|
Whitspace changes
svn path=/trunk/; revision=32770
|
|
svn path=/trunk/; revision=31401
|
|
Add support for FT_BOOLEAN fields to FieldInfo and TreeItem.
svn path=/trunk/; revision=30249
|
|
proto_item_set_len is missing from Lua API.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3994
svn path=/trunk/; revision=29837
|
|
Fixed some indents.
svn path=/trunk/; revision=28668
|
|
Update Lua documentation:
- Fixed Pref.enum, Pref.range and Pref.statictext
- Fixed the equivalent comment for pinfo.cols
- Do not have a comment star (*) in the documentation
- Be consistent and start all sentences with a capital letter
svn path=/trunk/; revision=28304
|
|
Document last argument to DissectorTable.new().
svn path=/trunk/; revision=27309
|
|
Fixes bug 2750.
svn path=/trunk/; revision=26216
|
|
svn path=/trunk/; revision=25937
|
|
Do not generate doc items for wslua garbage collectors (they are transparet)
svn path=/trunk/; revision=25857
|
|
Fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2453
The patch fixes the problem by extending the original "outstanding stuff"
approach.
Now the pointer itself won't be NULLified, instead we track the pointers with
their expiry state in structs in the outstanding_stuff list.
The Lua objects refers to those structs instead of the actual pointers and
checks the expiry state of the pointers before accessing them.
The pointers are marked expired when the dissection of the frame is finished
and the allocated struct is freed by Lua's garbage collector.
If the garbage collector hits the struct when it holds a not expired pointer,
it marks it as expired (that means we don't have any object in Lua referring to
the pointer) and the struct will be freed at the end of the dissection of the
frame.
this is for the 1.0 branch
svn path=/trunk/; revision=25845
|