Commit Graph

333 Commits

Author SHA1 Message Date
Stig Bjørlykke 7d7bf98a8e Added TvbRange uncompress().
svn path=/trunk/; revision=48422
2013-03-19 17:15:27 +00:00
Anders Broman 27744ecc2d From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48337
2013-03-16 08:12:29 +00:00
Stig Bjørlykke 187a884cea Update Lua BitOp to version 1.0.2
svn path=/trunk/; revision=48316
2013-03-15 15:15:00 +00:00
Anders Broman e022d129bd From beroset:
made implicit casts explicit and changed a number of fields and function return values from base_display_e to unsigned because the enum was not a comprehensive list of all possible values

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

svn path=/trunk/; revision=48289
2013-03-14 06:45:55 +00:00
Jaap Keuter 827eb58b04 From David Arnold:
Replace use of INCLUDES with AM_CPPFLAGS in all Makefiles to placate recent autotools.

svn path=/trunk/; revision=48261
2013-03-12 06:53:39 +00:00
Chris Maynard 756824e919 Fix Coverity CID 989732: Structurally dead code.
Also, change a few tabs -> spaces.  Add modelines.

svn path=/trunk/; revision=48257
2013-03-11 20:50:19 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
Bill Meier 9e436c6c4a Fix a misspelled word; Do some minor tweaking of the wording of a few comments.
svn path=/trunk/; revision=47903
2013-02-26 15:10:28 +00:00
Bill Meier 96a24cc79f Fix spelling/typos found using a list of commonly misspelled words.
The misspellings were mostly in comments but some were
in text strings visible to the user.


svn path=/trunk/; revision=47899
2013-02-26 04:42:26 +00:00
Bill Meier a6e56df8b6 it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47898
2013-02-26 02:38:52 +00:00
Michael Mann 2c7844cc69 Fix typos/errors and make Lua API more consistent.
From Hadriel Kaplan, bug 8393 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8393)

svn path=/trunk/; revision=47885
2013-02-25 22:05:28 +00:00
Michael Mann 41bd69d601 LUA API improvements
1. Add col_set_fence() equivalent
2. Update __tostring function to actually return column text

From Hadriel Kaplan, bug 8295 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8295)

svn path=/trunk/; revision=47882
2013-02-25 20:43:06 +00:00
Michael Mann 0f3f207967 Bugfix Lua pinfo.cols.protocol not holding value in postdissector
From Hadriel Kaplan, bug 6020 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6020)

svn path=/trunk/; revision=47877
2013-02-25 17:32:25 +00:00
Michael Mann d26c9b88cf Fix Lua 5.2 panic problems.
From Hadriel Kaplan, bug 7400 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7400)

svn path=/trunk/; revision=47874
2013-02-25 16:20:27 +00:00
Evan Huus 7bfb66f02f Invert the if statement into the common form:
if (error) return error;

do normal things;

svn path=/trunk/; revision=47829
2013-02-23 00:09:08 +00:00
Evan Huus f62c7e0b42 Add a return statement accidentally removed in r47783 and tweak the
brace placement so it's more obvious why the return is needed.

svn path=/trunk/; revision=47828
2013-02-23 00:06:30 +00:00
Evan Huus ceb5b89c84 Add modelines, fix indentation to be a consistent 4-spaces throughout.
svn path=/trunk/; revision=47784
2013-02-20 23:49:06 +00:00
Evan Huus fb88b48088 From Hadrien Kaplan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8357
Fix the Lua tostring() method on FieldInfo objects such that it always returns
a string, although the string might be '(unknown)', '(none)', or '(n/a)'. This
is more conformant to Lua's API style.

Also create a new 'FieldInfo.display' accessor table member, which Lua
scripts can use instead of tostring() to get what the GUI displays.

From me:
Misc indentation fixes, remove redundant 'return' statement.

svn path=/trunk/; revision=47783
2013-02-20 23:40:24 +00:00
Guy Harris 80b0bc752e Add a new WSLUA_CLASS_FNREG_ALIAS() macro to register methods where the
function name isn't the same as the method name; this is used if we're
providing compatibility aliases for method names.

Use WSLUA_CLASS_FNREG() and WSLUA_CLASS_FNREG_ALIAS() for all method
registrations.

Fix the spelling of "prepend", but leave a compatibility alias in place.

svn path=/trunk/; revision=47667
2013-02-15 01:38:45 +00:00
Anders Broman 68160dac5c From "temp4746":
wslua TvbRange:le_ustring/ustring buffer overflow's.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8175

svn path=/trunk/; revision=47012
2013-01-10 06:55:16 +00:00
Guy Harris b0d6fbcdeb OK, fine, maybe sometimes it's used; flag it with _U_ while we're at it.
svn path=/trunk/; revision=46750
2012-12-26 06:07:04 +00:00
Guy Harris a9635c3b9c If a parameter might be unused, mark it with _U_; don't stick in a fake
usage.

svn path=/trunk/; revision=46749
2012-12-26 06:04:05 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Jörg Mayer fed92f6ee2 Whitespace changes
svn path=/trunk/; revision=46403
2012-12-05 16:05:04 +00:00
Bill Meier 7cd0417af5 Fix numerous instances of a variable/parameter name "shadowing" a library function name;
(At least some (gcc ?) compilers give a "shadow" warning for these).

svn path=/trunk/; revision=46402
2012-12-05 15:56:36 +00:00
Stig Bjørlykke 37c7d006ad Added check for missing/empty ProtoField abbrev also in
integer, boolean, time and other cases.

svn path=/trunk/; revision=46302
2012-11-30 11:01:01 +00:00
Stig Bjørlykke 55aae6767c From mathewt via bug 8012:
Fixed lua le_int64() and le_uint64().

svn path=/trunk/; revision=46151
2012-11-23 11:20:35 +00:00
Stig Bjørlykke a875f6a6e8 Added check for missing/empty ProtoField abbrev.
svn path=/trunk/; revision=46078
2012-11-18 19:15:34 +00:00
Jakub Zawadzki b53dbea042 Make data_source opqaue, add getter for tvb.
svn path=/trunk/; revision=45672
2012-10-20 19:54:56 +00:00
Jakub Zawadzki e0fea3a34c Second try to fix wslua building.
svn path=/trunk/; revision=45603
2012-10-16 22:31:42 +00:00
Jakub Zawadzki a734f16e5b Try to fix building wslua.
svn path=/trunk/; revision=45602
2012-10-16 22:13:51 +00:00
Jakub Zawadzki 72ca9d0e61 Store pointers to previously displayed and captured packet, not nstime_t deltas.
This commit reduces size (from 144B to 128B on AMD64) of frame_data structure.

Part of bug 5821: Reduce per-packet memory requirements.

svn path=/trunk/; revision=45071
2012-09-23 16:25:28 +00:00
Jakub Zawadzki 9cde3e1a44 Add lua_nstime_to_sec()
svn path=/trunk/; revision=45070
2012-09-23 15:57:11 +00:00
Jakub Zawadzki 7719d4e84a Cleanup wslua PINFO_GET_* macros. It's portable, right?
svn path=/trunk/; revision=45067
2012-09-23 14:46:43 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Evan Huus dd01cc0490 From Niels Widger via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7725
Add get_filter method to Wireshark's Lua interface (to correspond with the
already-exposed set_filter method).

svn path=/trunk/; revision=44916
2012-09-15 13:58:57 +00:00
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +00:00
Jakub Zawadzki 5ad3e5331e MT: move global frame_end_routines to packet_info.
svn path=/trunk/; revision=44748
2012-09-03 12:00:40 +00:00
Evan Huus 1457a01f49 Always memset the packet-header struct in Lua to avoid
crashes from garbage data.

Also, give Lua a copy of the packet comment if there is one.

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

svn path=/trunk/; revision=44093
2012-07-28 15:51:37 +00:00
Evan Huus a234b68ff0 Fix some system header files that were #included with "" instead of <>.
They made cppcheck unhappy.

svn path=/trunk/; revision=43779
2012-07-18 02:47:56 +00:00
Anders Broman 45e9efc6a9 From Evan Huus:
Fix leaks

- don't g_strdup a string just to use it in a g_strdup_printf
- clean up properly in error cases in lua bindings
- misc. other missing g_free() calls
- one missing fclose() in the new 80211_utils

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

svn path=/trunk/; revision=43617
2012-07-09 01:56:27 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Anders Broman e6e6d6217b From Tony Trinh:
Update Lua from 5.1 to 5.2

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

svn path=/trunk/; revision=43482
2012-06-25 20:42:07 +00:00
Anders Broman 6efe4ea27c From Tony Trinh:
Update Lua from 5.1 to 5.2

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

svn path=/trunk/; revision=43479
2012-06-25 20:28:14 +00:00
Balint Reczey b90a1b7f63 Give hint to check http://wiki.wireshark.org/CaptureSetup/CapturePrivileges in Lua error messages related to running Wireshark as root
svn path=/trunk/; revision=43442
2012-06-22 15:18:03 +00:00
Guy Harris 4ad0bf65f2 Clean up indentation.
svn path=/trunk/; revision=43314
2012-06-17 16:32:04 +00:00
Jeff Morriss e9a30385c7 Fix Coverity 702396: tvbr is ep_ allocated so it can't be NULL.
svn path=/trunk/; revision=43116
2012-06-05 15:29:25 +00:00
Jeff Morriss fe5f076b5c Fix Coverity 702397: reference tvbr *after* checking that it is not NULL.
svn path=/trunk/; revision=43115
2012-06-05 15:26:09 +00:00
Chris Maynard 973b45c401 Add a "fallthrough" comment to avoid a missing break report from Coverity. Fixes Coverity CID 702382 Missing break in switch.
svn path=/trunk/; revision=42845
2012-05-25 01:49:49 +00:00