Commit Graph

266 Commits

Author SHA1 Message Date
Chris Maynard 647c5c0b27 packet_info's in_error_pkt is now a bitfield like in_gre_pkt.
svn path=/trunk/; revision=39764
2011-11-08 18:39:11 +00:00
Stig Bjørlykke 43c34aaf8e Do not return from within a TRY/CATCH/ENDTRY because this will make the
except stack invalid, and will lead to a crash.

In this case it was when calling a dissector from a table in a Lua script.

svn path=/trunk/; revision=39748
2011-11-07 07:41:03 +00:00
Stig Bjørlykke 0352ac8e8f From Robert G. Jakabosky via bug 5575:
Fix memory errors in Lua dissectors.
- Free Tvb when created from ByteArray.
- Free TvbRange correctly.
- Free string from get_persconffile_path and get_datafile_path.
- Some code cleanup.

svn path=/trunk/; revision=39744
2011-11-06 17:39:13 +00:00
Stig Bjørlykke e48b5f02e0 No need to ep_strdup a string to lua_pushstring.
svn path=/trunk/; revision=39684
2011-10-31 08:38:49 +00:00
Stig Bjørlykke 5a466a5246 Don't ep_strdup the protocol name when register a dissector, because
this name will be collected when loading a capture file and the name
will be gone.

svn path=/trunk/; revision=39681
2011-10-30 21:32:27 +00:00
Stig Bjørlykke 447de1178d Allow signed integers displayed as BASE_HEX_DEC.
svn path=/trunk/; revision=39571
2011-10-25 19:04:10 +00:00
Stig Bjørlykke 2d62e550b7 Added another Lua warning:
- FT_FRAMENUM can not have a bitmask.

svn path=/trunk/; revision=39563
2011-10-25 11:20:54 +00:00
Stig Bjørlykke 943c8b97ed Added Lua error messages when:
- Adding a INT64/UINT64 field with a value string (currently unsupported).
- Trying to display a signed integer as hexadecimal.

svn path=/trunk/; revision=39562
2011-10-25 11:13:11 +00:00
Stig Bjørlykke 4b930ccb33 Duplicate Lua strings we put into the private_table.
svn path=/trunk/; revision=39468
2011-10-19 15:32:49 +00:00
Stig Bjørlykke 82e0b65038 Added a private hash table to transport string values between dissectors.
This works between C and Lua.

In C the pinfo.private_table pointer must be initialized using
g_hash_table_new (g_str_hash, g_str_equal);

In Lua the values are available using pinfo.private.<key>, and the
table is created automatically on first usage.  It's possible to use
this datatypes: nil, boolean, number and string, but every value
is converted to string so numbers must be converted using tonumber()
on usage.  Boolean is either nil or an empty string.

svn path=/trunk/; revision=39461
2011-10-18 17:46:00 +00:00
Stig Bjørlykke 424463e083 Use PINFO_GET_BOOLEAN for visited.
svn path=/trunk/; revision=39458
2011-10-18 10:17:19 +00:00
Stig Bjørlykke 022929724b Added some Lua pinfo fields:
ethertype, fragmented, in_error_pkt, match_uint and match_string.

svn path=/trunk/; revision=39407
2011-10-13 19:39:35 +00:00
Stig Bjørlykke 72cdab4c31 From Alex Vallee via bug 6346:
Added Lua TvbRange unicode string methods.

svn path=/trunk/; revision=39225
2011-10-02 17:02:10 +00:00
Stig Bjørlykke 3e75b436a0 Added register action for loading Lua plugins.
Removed an unused argument to wslua_init().

svn path=/trunk/; revision=39214
2011-10-02 13:39:35 +00:00
Stig Bjørlykke c6eb911c93 Do case insensitive search for lua scripts to load.
Skip files starting with . also on windows, as the home directory
may be mounted from a server with a proper filesystem.

svn path=/trunk/; revision=38737
2011-08-25 19:01:05 +00:00
Stig Bjørlykke f7956e0e1d Add a method to fetch protocol description.
svn path=/trunk/; revision=38736
2011-08-25 18:52:54 +00:00
Stig Bjørlykke 67149a7874 Add some NSTime methods: add, sub and unm.
svn path=/trunk/; revision=38648
2011-08-21 18:06:53 +00:00
Stig Bjørlykke 9c7e12c572 Introduce NSTime Lua object to handle nstime_t.
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
2011-08-19 08:36:02 +00:00
Jeff Morriss 23c5165169 Clarify that Tvb_reported_length_remaining may return -1
svn path=/trunk/; revision=38485
2011-08-11 13:45:42 +00:00
Jeff Morriss fa4d32113c From Alexander Stein via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6175 :
The attached patch adds the method reported_length_remaining to tvb.

svn path=/trunk/; revision=38464
2011-08-11 00:49:43 +00:00
Jeff Morriss 4ee1d732fb Add a Tvb_reported_len Lua API; this may help satisfy bug 6175.
svn path=/trunk/; revision=38461
2011-08-10 21:45:53 +00:00
Gerald Combs b9d13c328d Load console.lua and dtd-gen.lua from an explicit path.
svn path=/trunk/; revision=38414
2011-08-08 19:10:19 +00:00
Jörg Mayer c15ff441c6 Replace deprecated glib functions.
In order to compile the whole project with -DG_DISABLE_DEPRECATED
the mate plugin needs to replace its usage of GMemChunk.
All other places should be clean.

svn path=/trunk/; revision=38392
2011-08-07 18:15:45 +00:00
Anders Broman 2f05cf4dcf From Michael Mann:
Added ability to display UTC time or UTC time with date.  I liked having the
difference between UTC and local time, not just setting local=UTC.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2629

svn path=/trunk/; revision=37898
2011-07-04 21:43:34 +00:00
Stig Bjørlykke 8dd3dc1ef2 From bug 6057:
Improved set_color_filter_slot documentation.

svn path=/trunk/; revision=37813
2011-06-28 09:11:18 +00:00
Stig Bjørlykke b979f2da27 From bug 6057:
Lua API: add support to temporary color filters (10 color slots)

svn path=/trunk/; revision=37801
2011-06-27 11:07:31 +00:00
Stig Bjørlykke 4ac2487d38 From Tony Trinh via bug 6018:
Add NULL checks and fix typos in Lua error print-outs

From me:
Use the error message "GUI not available" when using GUI functions in tshark.

svn path=/trunk/; revision=37788
2011-06-25 20:47:13 +00:00
Stig Bjørlykke a4dc6c0a7d Added check for invalid chars in abbrev in ProtoField functions.
This fixes bug 5569.

svn path=/trunk/; revision=37787
2011-06-25 19:39:16 +00:00
Stig Bjørlykke 1255b45566 Remove "range" from Lua's Pref.range(), as this value shall be fetched from
the "default".

This fixes bug 5896.

svn path=/trunk/; revision=37786
2011-06-25 15:42:41 +00:00
Stig Bjørlykke 0f24c1eb09 From Tony Trinh via bug 5894:
Added argument validation to Pref.range.

svn path=/trunk/; revision=37785
2011-06-25 15:24:55 +00:00
Stig Bjørlykke b3d0f00015 From Tony Trinh via bug 5960:
Fix TvbRange:string() so that it returns a string that contains all bytes
of the range, including zeroes (instead of being truncated at first zero).

svn path=/trunk/; revision=37763
2011-06-23 11:06:34 +00:00
Stig Bjørlykke dfb3cde56b Use guint32 internally to store mask.
This may fix bug 5734.

svn path=/trunk/; revision=37762
2011-06-23 10:52:40 +00:00
Stig Bjørlykke 5934925554 Rename Tvb_new_real to ByteArray_tvb, as it's a ByteArray function.
Documentation is generated from code.

This fixes bug 5199.

svn path=/trunk/; revision=37761
2011-06-23 10:43:49 +00:00
Stig Bjørlykke 6df263d634 Rename Tvb_tvb to TvbRange_tvb, as it's a TvbRange function.
Documentation is generated from code.

This fixes bug 5006.

svn path=/trunk/; revision=37760
2011-06-23 10:28:53 +00:00
Gerald Combs 0272ec5dd3 Show the plugin paths in Help→About→Plugins. Add a "-G plugins" option
to TShark which dumps a list of plugins.

svn path=/trunk/; revision=37512
2011-06-01 21:48:17 +00:00
Jeff Morriss f3f9f2697f Make TVBs opaque for most users.
Convert TVB_RAW_OFFSET() and TVB_GET_DS_TVB() into functions.

svn path=/trunk/; revision=37422
2011-05-27 03:06:50 +00:00
Jeff Morriss fcac4a1d7d Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5930 :
with a variant of the patch submitted by Alexander Stein on the -dev list:

Allow FT_FRAMENUMs to be added (as base BASE_NONE).  My change from Alexander's
patch is to disallow BASE_NONE for non-framenum integers.

svn path=/trunk/; revision=37239
2011-05-18 15:33:07 +00:00
Guy Harris 1372515b02 More eradication of old-style function definitions.
svn path=/trunk/; revision=37216
2011-05-17 22:18:32 +00:00
Jakub Zawadzki 0edf3eafa9 Comment out dead code.
svn path=/trunk/; revision=37029
2011-05-09 12:49:39 +00:00
Gerald Combs b223e99e5a get_host_ipaddr() was returning numeric addresses in host byte order
and hostnames in network byte order. Have it return everything in
network byte order.

svn path=/trunk/; revision=36873
2011-04-26 17:13:37 +00:00
Stig Bjørlykke 43851d797d Include config.h only from .c files.
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
2011-04-21 13:13:39 +00:00
Guy Harris c0e5dc8489 Zero is zero is zero, as Gertrude Stein didn't say.
svn path=/trunk/; revision=36639
2011-04-14 06:28:25 +00:00
Jeff Morriss a148a936b1 From Felix Kraemer: fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5694 :
This patch adds the capability to create BACnet statistics trees. 
Find the respective menu items under 'Statistics->BACnet'.
Packets can be sorted by different criteria:
- Src/Dst IP adresses
- Instance ID
- Object Type
- Service

From me:
- Don't use C++/C99-style comments.
- Name variables for tick_stat_node() don't need to be static.
- Change updateBacnetInfoValue() to require 'data' to be ep_ allocated.  Change
  the couple of calls that did not send in ep_ allocated data to do so.
- Change one or two functions to be static.
- Do not use (memory-unsafe) g_sprintf().
- Use ep_strconcat() instead of leaking memory with g_strconcat().
- Put back one if(tree) that doesn't appear to do any harm.
- Remove variable declarations and #includes from the header file.

svn path=/trunk/; revision=36468
2011-04-05 02:18:28 +00:00
Jaap Keuter 1048f71f5d From David Carne:
col_set_str simply stores the pointer passed to it, and luaL_checkstring
returns a temporary pointer. Changing col_set_str to col_add_str in
Columns_newindex seems to fix the issue.

svn path=/trunk/; revision=35795
2011-02-03 23:17:31 +00:00
Bill Meier d3efa3ed9f A bit of Windows makefiles rework and cleanup:
- Define macros for certain CFLAGS in config.nmake iso of having defs in each makefile;
  a. -DHAVE_CONFIG_H and -D_U_="" are now part of a macro named STANDARD_CFLAGS;
  b. -WX has been replaced by WARNINGS_ARE_ERRORS (defined as -WX in config.nmake)
      (This allows disabling "Warnings as Errors" by just changing config.nmake)
  c. CVARSDLL definitions (not usage) have been removed from the various makefiles.
     XXX: It appears the usage of CVARSDLL can also be removed (not yet done) since:
     -DWIN32 and -DNULL=0 do not appear to be needed (any more);
     -D_MT and _D_DLL  are not needed since /MP causes these definitions.
  d. Define a macro WARNINGS_CFLAGS with additional specific compiler (level4) warnings to be enabled.
     E.G., 4295: array is too small to include a terminating null character
- config.nmake: reformat some long lines for readability;
- plugins\Makefile.nmake: clean-deps does nothing: remove it (and usage in top-level makefile);
- dissectors/Makefile.nmake: test to enable packet-rrc.obj target needs to include MSVC2010 ...

svn path=/trunk/; revision=35747
2011-02-02 01:19:53 +00:00
Jaap Keuter 70d55366ae Add a Manual entry to the Lua menu.
svn path=/trunk/; revision=35729
2011-01-31 21:13:20 +00:00
Bill Meier 79e8fdf14f Put back a 'return' statement so GCC doesn't generate a warning...
svn path=/trunk/; revision=35716
2011-01-31 04:23:46 +00:00
Bill Meier 8a07e469f3 Fix a number of msvc level 4 "Unreachable code" warnings by removing unneeded
return statements.

svn path=/trunk/; revision=35709
2011-01-30 22:32:25 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Balint Reczey 0e9ed5ecf0 Move wslua_plugin_list to epan/plugins.c, that should fix the Solaris builds finally.
svn path=/trunk/; revision=35167
2010-12-10 10:37:03 +00:00