Commit Graph

25147 Commits

Author SHA1 Message Date
AndersBroman 01b65269bf Inlining some tvb function gives a 6% performance gain according to
valgrind.

Change-Id: I7881f8c1407d422a3f1ad5bc17e975b45703db74
Reviewed-on: https://code.wireshark.org/review/909
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-01 15:41:33 +00:00
Graham Bloice 8c5e9fcb82 Fixed display of IIN during reads and writes of IIN object.
Added (hidden) dnp3.addr field set by both source and destination dnp3
addresses to allow easier filtering.

Change-Id: I04980c24c1b9f30a2ee5a0d5ea4ac32ae877504e
Reviewed-on: https://code.wireshark.org/review/908
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Graham Bloice <graham.bloice@trihedral.com>
2014-04-01 13:05:45 +00:00
AndersBroman 2284f0bdfa For now use UTF-8 for all strings for performance reasons.
Change-Id: If47ffbee58d534ce3d44f00e1e5b966bc42a2ea8
Reviewed-on: https://code.wireshark.org/review/906
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-01 08:06:16 +00:00
Hadriel Kaplan 97cddf538c Fix proto.c to pass checkAPIs script
Since proto.c was using strcat(), changes to the file won't pass checkAPIs.
So this commit replaces it with the appropriate function, and also replaces
the deprecated tvb_length_remaining and tvb_ensure_length_remaining function
calls with the new versions, since checkAPIs was warning about that too.
This commit does not change the ep_* memorry calls to the new wmem-based
ones though, as that's a bigger deal than this trivial commit I think.

Change-Id: I51e6d5b3a6e03233f2695c890ff4c10d02fdb0c0
Reviewed-on: https://code.wireshark.org/review/905
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-01 06:03:57 +00:00
Bill Meier a8e9637090 Fix two bugs and do misc other minor changes;
Bugs fixed:
 - col_...() should not be called under 'if (tree)';
 - proto_reg_handoff_pdc(): pdc tcp.port preference change was handled incorrectly;

Minor changes:
- Move proto_reg_handoff...() to the end of the file as per convention;
- new_register_dissector...() call not needed;
- Remove some unneeded initializers;
- 'xxx++' ==> 'xxx += 1' in a few instances;
- widen a few variables (guint? ==> guint);
- Add XXX comment about possible simplification of the code;
- Remove unneeded #include <epan/reassemble.h>;
- Reformat hf[] entries for readability;
- Do whitespace changes;

Change-Id: Ib9224f0c6392a45c19656a63bbac97fbaf3acc08
Reviewed-on: https://code.wireshark.org/review/900
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-04-01 03:46:02 +00:00
Bill Meier a72dc7a2dd Fix expert_...() calls to not be under 'if (tree)';Do other minor changes;
Minor changes;
 - Remove #include <epan/etypes.h>; It's not needed;
 - Do some whitespace changes;
 - Use tab-width=8 in editor modelines

Change-Id: I84a1c9bc814fae384c4d5a434c2f9aed865c76ae
Reviewed-on: https://code.wireshark.org/review/899
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-04-01 03:44:58 +00:00
Alexis La Goutte b7b33b54bd Continue to remove $Id$ from top of file
Last one $Id$ (remove by hand) to make checkAPI haapy !

Change-Id: I5adfdcac0629a36e08c5fe3ea7960bdbc251364f
Reviewed-on: https://code.wireshark.org/review/887
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:49:52 +00:00
Alexis La Goutte 7d77d753c6 Continue to remove $Id$ from top of file
(Using sed :sed -i '/^\/\* \$Id\$ \*\//,+0 d') ( /* $Id */ )

Change-Id: I46e928d7f2a307c35876ed5d34cb6b7cccfcd6e9
Reviewed-on: https://code.wireshark.org/review/886
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:49:26 +00:00
Alexis La Goutte 757aa33220 Continue to remove $Id$ from top of file
(Using sed : sed -i '/^\# \$Id\$/,+1 d') (start with dash)

Change-Id: Ia4b5a6c2302f6a531f6a86c1ec3a2f8205c8c2dd
Reviewed-on: https://code.wireshark.org/review/881
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:48:06 +00:00
Alexis La Goutte b0ba475fbf Continue to remove $Id$ from top of file
(Using sed : sed -i '/^  \$Id\$/,+1 d') (No star only 2 spaces before)

Change-Id: Id7b254031769a9dca2941304e4d3a0f4bdbc3f54
Reviewed-on: https://code.wireshark.org/review/883
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:46:57 +00:00
Evan Huus a8f1e349c3 Doc tweaks and macro parameterization
Change-Id: I9898bedf05a785683e79866a149336cbbf402d27
Reviewed-on: https://code.wireshark.org/review/892
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-31 18:44:26 +00:00
Alexis La Goutte 09cd306d1c Continue to remove $Id$ from top of file
(Using sed : sed -i '/^\* \$Id\$/,+1 d') (no space before star)

Change-Id: I318968db2b8512ba1303b5fc5c624c66441658f0
Reviewed-on: https://code.wireshark.org/review/879
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:30:52 +00:00
Alexis La Goutte f2dfc39d94 Continue to remove $Id$ from top of file
(Using sed : sed -i '/^ \t$Id\$/,+0 d') (tab before $Id$)

Also modify generator (NDR.pm)

Change-Id: I348a1d129d1d1320bd80b428038ea5ed291d6ca8
Reviewed-on: https://code.wireshark.org/review/878
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:29:18 +00:00
Alexis La Goutte 94a791a76e Continue to remove $Id$ from top of file
(Using sed : sed -i '/^\$Id\$/,+1 d') (No space or star before $Id$)

Change-Id: I0801bd7cf234d32487008a8b6dcee64875b07688
Reviewed-on: https://code.wireshark.org/review/876
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-31 16:00:04 +00:00
Alexis La Goutte 3170f2e418 Continue to remove $Id$ from top of file
(Using sed : sed -i '/^ \*  \$Id\$/,+1 d') (Double space between star and $Id$)

Change-Id: If9b8f345e3b6493de0b573600e60005c8b0b33c3
Reviewed-on: https://code.wireshark.org/review/877
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-31 15:59:51 +00:00
AndersBroman d0edbd31eb Use tvb_get_string_enc() with UTF_8 when checking headers as it's faster.
Change-Id: I88cd6f71c1fcbf67948dd0ebdc6e5641d6ba111c
Reviewed-on: https://code.wireshark.org/review/891
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 15:59:15 +00:00
AndersBroman b3708a9c4a According to RFC 3261
7 SIP Messages

   SIP is a text-based protocol and uses the UTF-8 charset

So use ENC_UTF_8|ENC_NA.

Change-Id: I0101eca3dd7d8ff9ebf98fd733548131b862919e
Reviewed-on: https://code.wireshark.org/review/890
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 15:51:27 +00:00
AndersBroman 6a3394eefa Inlining wmem_strbuf_grow seems to give better performance.
Change-Id: I80f3d42fb01461af97984b463a6e8b8217eed552
Reviewed-on: https://code.wireshark.org/review/888
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 15:20:08 +00:00
Alexis La Goutte 0973a321a9 Fix Argument with 'nonnull' attribute passed null found by Clang
Change-Id: Ie59c379a4f00c807ebc50c95eea2017f8cac0c69
Reviewed-on: https://code.wireshark.org/review/796
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-31 08:29:18 +00:00
Hanspeter Portner 650ed5f249 packet-osc dissector bug fix of path validity func
- 'is_valid_path' function has been corrected
- an OSC path is valid if:
 - it consists of printable characters only
 - does not contain ' ' and '#'
- characters '*' ',' '?' '[' ']' '{' '}' are valid, but have special meaning at the receiving end (used for pattern matching)

Change-Id: I4ff4308d0955da2ef377d606b7778819b97754a0
Reviewed-on: https://code.wireshark.org/review/868
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-31 06:43:10 +00:00
Gerald Combs 5cdf04e6c7 [Automatic manuf, services and enterprise-numbers update for 2014-03-30]
Change-Id: Iff714193adc4035d96f69d4944b43da7edb3cfa8
Reviewed-on: https://code.wireshark.org/review/869
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-30 15:31:27 +00:00
Guy Harris d156deff04 Rename "size" variable to "length", to match other string routines.
Change-Id: I385345cfafc7e7b4d3e66713fb0fe570b39f438d
Reviewed-on: https://code.wireshark.org/review/865
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-29 20:23:09 +00:00
Evan Huus 521bab1e1c Use sized strbufs when extracting tvb strings
We rarely know exactly how long a string will be, but we frequently have a good
lower bound (that's better than the default strbuf size of 16). Starting at that
size probably reduces the amount of allocation/copying needed.

Also make use of the new _finalize() method to save memory and avoid constness
problems.

Change-Id: I3f043bd12c1ccfce5990168fb6531ecd287bec5b
Reviewed-on: https://code.wireshark.org/review/856
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-29 20:01:17 +00:00
Evan Huus 7df883954e Splay tree implementation for wmem
This is a tree implementation intended to replace the current red-black tree in
wmem_tree (which was inherited from emem), assuming there are no regressions.
Splay trees bubble recently accessed keys to the top, and as such have a number
of very nice properties: https://en.wikipedia.org/wiki/Splay_tree

This implementation is a variant known as "independent semi-splaying", which has
better practical performance. It should do about as well as the red-black tree
for random insertions and accesses, but somewhat better for patterned accesses
(such as accessing each key in order, or accessing certain keys very
frequently).

There are a few other changes relative to the red-black tree implementation that
are worth mentioning:
 - Instead of requiring complex keys to be split into guint32 chunks and doing
   this weird trick with sub-trees, I let the keys be arbitrary pointers and
   allowed the user to specify an arbitrary comparison function. If the function
   is NULL then the pointers are compared directly for the simple integer-key
   case.
 - Splay trees do not need to store a red-black colour flag for each node. It is
   also much easier to do without the parent pointer in each node. And due to
   the simpler system for complex keys, I was able to remove the "is_subtree"
   boolean. As such, splay nodes are 12 bytes smaller on 32-bit platforms, and
   16 bytes smaller on a 64-bit platform.

All done in about half the lines of code.

Change-Id: I89fb57e07d2bb7e3197190c7c2597b0c5adcc03b
Reviewed-on: https://code.wireshark.org/review/758
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-29 18:01:55 +00:00
Evan Huus adc46f571c Tighten the NO_MORE_DATA_CHECK macros
We should return if we've already somehow overflowed the apparent length, not
just if we've hit it dead on.

Fixes bug #9932 and probably others.

Change-Id: I2719c3bd38f03e18ea557df962ee4a1beb64c2e8
Reviewed-on: https://code.wireshark.org/review/862
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-29 16:04:50 +00:00
Hadriel Kaplan 302632f4b3 Fix some compiler issues on windows with Lua 5.2
Change-Id: I5c692bbc5fd1a9f0d361413e44e70282c3299901
Reviewed-on: https://code.wireshark.org/review/860
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-29 12:36:48 +00:00
Evan Huus 48fc43baad Implement finalize() method for wmem strbuf.
Change-Id: Ib7a2b0d348b3624f41253e2d0995a4a38a9fe45d
Reviewed-on: https://code.wireshark.org/review/859
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-29 12:11:21 +00:00
Pascal Quantin 7785dd00cd Please checkAPI.pl
Change-Id: I78e9d3781df81fd4edda7e9b20749cb096a05499
Reviewed-on: https://code.wireshark.org/review/861
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-28 22:51:50 +00:00
Bill Meier a8562b2a66 Add handling of OSC over TCP; fix a bug in the UDP heuristic.
Bug Fixed: UDP heuristic wasn't properly setting the dissector
for the UDP conversation.

From https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9837#c3:

 I did a little survey about alternative OSC transmission, but UDP.

 As OSC is packet-based, it is tramitted raw via packet-oriented protocols (e.g. UDP).

 For reliable stream-based protocols (TCP, USB), the raw OSC packet is
 prefixed with the packets Int32 size as a packetization scheme.

 For unreliable stream-based protocols (RS232 and other serial lines),
 the raw OSC packet is SLIP and/or double SLIP encoded as packetization
 scheme.

 There was discussion in the past to make SLIP encoding the default for
 all stream-based protocols, but apparently it has never been adopted
 for any OSC via TCP implementation I've found in the web.

 As OSC is used in networked Audio, most implementations run with the
 Nagle algorithm disable, and send the prefixed length and the raw OSC
 packet separately.

Change-Id: Ife690cc5ea0575c65124a7b441431e1cc6ba5091
Reviewed-on: https://code.wireshark.org/review/858
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-28 18:00:41 +00:00
AndersBroman f7c62543f9 tvb_get_ascii_string is really expensive. On a large capture file which I
profiled in october Fetch cost has gone from 15,6M to 24,2M, changing
tvb_get_string() to tvb_get_string_enc() with ENC_UTF_8 where it seems
safe helps a bit and should be done any way.

Change-Id: I4d3e640bfde3304a991c09e2a30ad7dd132fc5ac
Reviewed-on: https://code.wireshark.org/review/855
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-28 14:05:29 +00:00
Hadriel Kaplan 2c1e673fa2 Allow chained calls with Lua TreeItem functions, and fix a couple of minor 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>
2014-03-28 04:27:43 +00:00
Martin Kaiser 0ffc690da4 dissect sRGB chunk
Change-Id: I5a9eefb7f5108de0e46b70453a4485b1cbc3983d
Reviewed-on: https://code.wireshark.org/review/850
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-27 21:42:23 +00:00
Martin Kaiser ca384a1324 use an expert info if a png chunk is too large for us
Change-Id: I6a06bf297ef68ca351deff2e08eec7cd12ba8fe0
Reviewed-on: https://code.wireshark.org/review/849
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-27 21:42:05 +00:00
AndersBroman 9a977fc8d0 Add dissection of 3G Interface Type package and add some comments about
the usage of variables in the h248_package_t struct.

Change-Id: Ic5419ab5c20051e56963fe8ea1728d78f95538f0
Reviewed-on: https://code.wireshark.org/review/846
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-27 16:54:05 +00:00
AndersBroman d1bef29125 Regenerate the dissector with the latest template.
Change-Id: Iefdd7122537108c37e71650ad2674418109d2f1b
Reviewed-on: https://code.wireshark.org/review/845
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-27 14:09:23 +00:00
Pascal Quantin 418c3a7f62 NAS EPS: display also detach cause in case of network initiated procedure
Change-Id: I36fef9eb8a81b03f29c812f94524f4cdf056448b
Reviewed-on: https://code.wireshark.org/review/844
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-27 12:52:20 +00:00
Pascal Quantin 3dd4ef59bb MBIM: fix identification of DSS streams and add a way to register an external dissector for DSS
Change-Id: Ic7f5708b60ee5846d95725dbbd14d8958d43372e
Reviewed-on: https://code.wireshark.org/review/843
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-27 10:12:27 +00:00
AndersBroman 3584a21c87 From Martin Mathiesson: Display Detach Type in info col.
Change-Id: I33692ac93f60cbabec0804f6ee7e75a9d5b9497c
Reviewed-on: https://code.wireshark.org/review/842
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-27 09:50:44 +00:00
Hadriel Kaplan f3fe29f0fc Add paths to Lua package.path so require works for user scripts
This adds the global and personal plugins directories to the
package.path setting in Lua, so doing 'require' will work
properly.

Change-Id: Iec33bc60cd7d41aa122da456db91d4ccc3085f82
Reviewed-on: https://code.wireshark.org/review/841
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-27 05:03:39 +00:00
Martin Kaiser 09055f18a5 two more chunk names
Change-Id: I5a34a59c88a4119be2fac4acdd352d474ffc62cd
Reviewed-on: https://code.wireshark.org/review/840
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-26 22:24:44 +00:00
Martin Kaiser 949747697c add some more chunk names
Change-Id: I6d294a901af88f993ca6a44ababad194fb44a693
Reviewed-on: https://code.wireshark.org/review/839
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-26 22:16:40 +00:00
Martin Kaiser d5ddfed512 clean up the png dissector
use value_string instead of our own data type
read the type string in one go

Change-Id: I115c99c4636540702c1fd301f09a92a0dd466fcd
Reviewed-on: https://code.wireshark.org/review/838
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-26 22:16:22 +00:00
Martin Kaiser 436100c66a use the correct png chunk len
the parameter for proto_tree_add_text() is the length, not the end offset

Change-Id: Ie24d5982b7ff13363061fb087438dd714cae748a
Reviewed-on: https://code.wireshark.org/review/837
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-26 22:16:03 +00:00
AndersBroman 873a96fab1 Fix off by one error
Change-Id: I24c9e988786a95489f918bed2c043e6eb23e4caa
Reviewed-on: https://code.wireshark.org/review/834
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-26 12:11:39 +00:00
Hadriel Kaplan 8c2bb80574 Add various functions for Lua directory handling and path info
This adds new functions to get plugins path info, find out if a directory
exists, make a new one, remove one, etc. It also creates a file environment
for user-supplied Lua scripts, to prevent global variable contamination as
well as supply the script-specific file name.  Some other minor cleanup was
done as I found them.

A new testsuite was added to test the existing and new directory functions.

Change-Id: I19bd587b5e8a73d89b8521af73670e023314fb33
Reviewed-on: https://code.wireshark.org/review/832
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-26 07:37:34 +00:00
Hadriel Kaplan da1af6e549 Add filterable expert info for Lua
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>
2014-03-26 05:20:17 +00:00
Pascal Quantin b981173669 LTE RRC: fix dissection of SystemInfoListGERAN IE
Change-Id: I502f7cd97cf00822900b4cd09e183e3b491c1437
Reviewed-on: https://code.wireshark.org/review/831
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-25 23:14:50 +00:00
Pascal Quantin 38b5efd5cf MBIM: fix dissection of control packets when capturing with usbmon
Change-Id: Ie20fcb8d393a85d47ba78f6cb70de77fedda2587
Reviewed-on: https://code.wireshark.org/review/829
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-25 22:04:23 +00:00
Martin Kaiser 843054ce96 no need for if(tree)
Change-Id: If95ece8e2db1b650de5804465128020caf391956
Reviewed-on: https://code.wireshark.org/review/828
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-25 20:38:50 +00:00
Martin Kaiser 027ecfb658 use wmem_ascii_strdown()
Change-Id: Iaa7dfdc979e78f53b53f2b9a0b093873c9004f2d
Reviewed-on: https://code.wireshark.org/review/827
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-25 20:38:33 +00:00