Commit Graph

355 Commits

Author SHA1 Message Date
Michael Mann dcf6d44b7f Apply refactored "conversation" (tap) data to TShark.
I intentionally left the fields displayed alone (so they don't exactly match Wireshark GUI), because as Guy points out in bug 6310, not sure its A Bug or A Feature.  But at least all types of conversations allowed are in sync with Wireshark GUI.

Bug:6310
Change-Id: I722837df510a39dadc1f9a07a99275509516698c
Reviewed-on: https://code.wireshark.org/review/3212
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-30 16:12:54 +00:00
Michael Mann 31ecdf5b06 Refactor "common" Conversation table functionality.
Refactor (non-GUI) conversation table functionality from gtk/Qt to epan.  Also refactor "common GUI" conversation table functionality.

The idea is to not have to modify the GUI when a dissector adds a new "conversation type"

Change-Id: I11f08d0d7edd631218663ba4b902c4a4c849acda
Reviewed-on: https://code.wireshark.org/review/3113
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-26 20:59:42 +00:00
Michael Mann 4d58904a09 convert to proto_tree_add_subtree[_format]
Change-Id: Ie10ac4f5f04a23344d183e095bbafb23c6409144
Reviewed-on: https://code.wireshark.org/review/2904
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-07 00:03:35 +00:00
Evan Huus d70e56a733 Revert to 3ms if we don't have the handshake
Change-Id: I96b23677f3050e9c62edd49f26d50d8b4addcf58
Reviewed-on: https://code.wireshark.org/review/2784
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-03 07:32:11 +00:00
Jakub Zawadzki 6e0be0173b Add col_append_lstr(), speedup column generation for TCP.
When dissecting with columns TCP dissector spends
around 1/4 time in col_append_fstr(), add col_append_lstr()
and do formatting by ourselves.

Change-Id: If90bc26242761884b4991e8db0db62c8f9e32690
Reviewed-on: https://code.wireshark.org/review/2527
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-23 03:33:59 +00:00
Pascal Quantin 6808afd017 TCP: update the list of options and put Kind and Length items in the right subtree
Bug: 10211
Change-Id: Ide37f2a2b33f0d6d7cdff897eed02a8c1ea24f7d
Reviewed-on: https://code.wireshark.org/review/2488
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-20 18:51:27 +00:00
Evan Huus 80c070fb51 Don't hide tcp option kind/len fields
Hidden fields are deprecated, and we were hiding them inconsistently anyways.

Bug:10211
Change-Id: Iaf1576ae7bc04c0c0bd896c096b117f1b8af2e9e
Reviewed-on: https://code.wireshark.org/review/2474
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-20 06:07:41 +00:00
Joerg Mayer 13597c9363 Rename the filtername to initial_rtt
Change-Id: I64af535dc07eb4310b212077bb4c52032e97ecdb
Reviewed-on: https://code.wireshark.org/review/2413
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-18 20:57:53 +00:00
Joerg Mayer 461c6a0984 Rename the Shortname of initial RTT to something short (iRTT)
Change-Id: I182f2cccae5a385572950f08fa0a6005dcf59ff1
Reviewed-on: https://code.wireshark.org/review/2409
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-18 19:58:37 +00:00
Joerg Mayer 67dac5985f Change the indication for out-of-order packets. This is experimental
and will be verified by Jasper next week

Change-Id: I3cda397285e8174abb9c05b7aaf7c1bfabdfc71a
Reviewed-on: https://code.wireshark.org/review/2408
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-18 19:55:12 +00:00
Joerg Mayer c6324a0b1e Get rid of some ancient qualityreview comments...
Change-Id: If25bdd594b20b656c345dcfe62765379f5dd9c5e
Reviewed-on: https://code.wireshark.org/review/2392
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-18 17:47:18 +00:00
Evan Huus b5a462b087 Try to calculate the initial RTT of tcp conns
This (if it works well) will let us do much more accurate out-of-order
detection, which is currently otherwise hardcoded to 3ms. Ask Jörg for details.

Change-Id: Ie0662723946edeaea1e43958bf7f5158f09dde71
Reviewed-on: https://code.wireshark.org/review/2367
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-18 15:07:08 +00:00
Pascal Quantin 04c90090d9 TCP: do desegmentation sanity checks for all sub dissectors types
Change-Id: I02fe9827d8c1618f7dc6696e7d8667681a48d4a9
Reviewed-on: https://code.wireshark.org/review/2355
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-18 05:53:10 +00:00
Joerg Mayer d5e2782629 Update a comment about how to better identify retransmissions
Change-Id: Iec83f7e713a3077f1f4569aa86a55a69684b3097
Reviewed-on: https://code.wireshark.org/review/2351
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-17 22:37:33 +00:00
Jakub Zawadzki 60daebaf16 Use tcp_info_append_uint() more
Change-Id: I27656eacb698f8db7bfbe4f5502658c78b03fc13
Reviewed-on: https://code.wireshark.org/review/1890
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-30 20:48:46 +00:00
Alexis La Goutte c3b2b54c92 Fix indent (use 4 spaces)
Change-Id: I9e37c911865a0e3b13331ec03df05d79749904c5
Reviewed-on: https://code.wireshark.org/review/1811
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-28 00:02:07 +00:00
ruengeler a60c661dda Call dissect_ip_tcp_options to save the window scale.
Change-Id: I411b16cdb3bc128cb49218080179c43e13f96e99
Reviewed-on: https://code.wireshark.org/review/1723
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-22 16:35:44 +00:00
AndersBroman 2cfda31ff0 Change the signature of dissector_try_heuristic() to return hdtbl_entry
which can be used to call the found heuristic dissector on the next pass.

Introduce call_heur_dissector_direct() to be used to call a heuristic
dissector which accepted the frame on the first pass.

Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582
Reviewed-on: https://code.wireshark.org/review/1697
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-21 20:17:29 +00:00
AndersBroman 5235dc6ca0 Only call ep_tcp_port_to_display/ep_udp_port_to_display once for sorce and
destination ports.

Change-Id: I490a716b7991d0d7dfcaecd722a267c77af2e776
Reviewed-on: https://code.wireshark.org/review/1682
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-18 20:13:52 +00:00
Jakub Zawadzki ea95c837fe Introduce col_add_lstr(), use it instead of slower col_add_fstr.
We have callgrind benchmarks which shows that col_add_fstr() takes
5% of Ir count cause of formatting done in g_vsnprintf().

New col_add_lstr() can be used in few dissectors without much ugliness,
and it should be a little faster.

Change-Id: Ifddd951063dfd3a27c2a7da4dafce9b242c0472c
Reviewed-on: https://code.wireshark.org/review/1629
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-17 21:33:26 +00:00
Peter Wu d7c4bde279 tcp: display calculated checksum
While debugging a network issue, I found incorrect TCP checksums. These
are shown in the packet details, but are not available as column. This
patch adds the "tcp.checksum_calculated" field which is only available
if a checksum can be calculated (i.e., checksumming is enabled and the
full segment is available).

The fields are added separately for each checksum case to make it appear
before "Checksum Bad/Good" and to avoid calculating the expected field
value for the "good" cases.

Change-Id: I36af7894d526382ef636c5fa51e74871212b2909
Reviewed-on: https://code.wireshark.org/review/1627
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-14 16:59:04 +00:00
Bill Meier 483e459a7e Do some cleanup related to deprecated function names and revised function return values):
- tvb_length_remaining() ==> tvb_captured_length_remaining();
- tvb_ensure_length_remaining() ==> tvb_ensure_captured_length_remaining();
- tvb_(captured|reported)_length_remaining() now return 0 instead of -1 if error
   and thus MAX(0, ...) is no longer required;
- Rename variable: length_remaining ==> captured_length_remaining;
- tabs ==> spaces (to match editor modelines).

Change-Id: I93b947a0a4cc52ccd2ad21c914abf4c4218b59e6
Reviewed-on: https://code.wireshark.org/review/1610
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-05-12 16:00:26 +00:00
Alexis La Goutte 8c167e17c4 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I3c54712108978d1bafe2b5da96e6a7d3d41948b5
Reviewed-on: https://code.wireshark.org/review/1535
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-07 00:52:01 +00:00
Jakub Zawadzki be3a153707 tcp: move & optimize printing tcp flags to seperate routine.
The formatting routine is quite simple so it can be replaced with
g_stpcpy() and still keeping it clean.

Change-Id: Ifbab1dc1140ee271d39bbbfb7586cfda6ded5c54
Reviewed-on: https://code.wireshark.org/review/1517
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 06:41:48 +00:00
Michael Mann 66a430349f Cache the "tcp_tree" with p_add_proto_data. Bug 9518.
This is more reliable than doing "tree math" and corrects the intention of 5470356154 which made the incorrect assumption that tcp_dissect_pdus will be called with the tree that is passed into a protocol's main dissection function (directly from TCP).

Change-Id: I6ffc2188420ab74784c7bc2c69aa79ff071c90b6
Reviewed-on: https://code.wireshark.org/review/1214
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-22 13:45:35 +00:00
Guy Harris 97869f2dec More name changes.
Add ep_ to routines that may return ephemeral strings.

Change "get_XXX" to "XXX_to_display" if the routine returns a formatted
string if it can't get a name.

Change-Id: Ia0e82784349752cf4285bf82788316c9588fdd88
Reviewed-on: https://code.wireshark.org/review/1217
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-19 19:30:17 +00:00
Guy Harris ad0066c81e Save and restore the current_proto string in tcp_dissect_pdus().
That way, the right protocol gets shown for exceptions in PDUs after the
one for which dissection failed.

Change-Id: I9f212fe55f19a7a818cd58cd0611683cbb723c0c
Reviewed-on: https://code.wireshark.org/review/1189
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-17 21:38:38 +00:00
Michael Mann b40cb1adea Apply found fix-encoding-args.pl errors in the dissector directory.
I coincidentally found a few files with errors, so I thought it might be time to run it on the whole directory again.

Change-Id: Ia32e54b3b1b94e5a418ed758ea79807c8bc7e798
Reviewed-on: https://code.wireshark.org/review/978
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-06 15:11:36 +00:00
Guy Harris 8881f3f61a Don't truncate the options field.
Create a placeholder protocol tree item under which to put the options,
do the analysis of fields from the fixed-length portion of the TCP
header (such as sequence numbers), and then do a straightforward
dissection of the options, throwing an exception if we run past the end
of the options field.

This is a bit simpler, and doesn't add confusing notes about
truncation of the options.

XXX - we're currently not including selective acknowledgments in any of
the SEQ/ACK analysis; should we?  That means, of course, that we have to
dissect the options before doing that analysis, and if the options were
cut short by slicing, you lose....

Change-Id: I425a6c83f26512b802267f76739cbf40121b3040
Reviewed-on: https://code.wireshark.org/review/511
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-05 02:33:20 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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>
2014-03-04 14:27:33 +00:00
Evan Huus 21e0a63b29 Add remove_last_data_source and fix bug 9169
The OP asked 9169 to be reopened because the capture was spewing ~40GB of output
when dissected with tshark. Investigation showed this was because the HTTP
dissector was requesting ONE_MORE_PACKET reassembly a lot, and TCP was adding
each step as a data-source which was being printed by tshark's hex dump. This
was leading to O(n^2) of output.

To fix, introduce function remove_last_data_source which removes the most recent
data source from the list. If the subdissector in TCP reassembly asks for
ONE_MORE_PACKET, assume it hasn't added any tree items (since it shouldn't have)
and remove the data source since it is unnecessary.

This may break dissectors which add tree items and *then* return
ONE_MORE_PACKET, since they will have their data source removed out from under
them. I believe those cases should be fixed to not add tree items until they're
sure they have enough data.

Change-Id: Iff07f959b8b8bd1acda9bff03f7c8684901ba8aa
Reviewed-on: https://code.wireshark.org/review/38
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-01-30 22:11:41 +00:00
Guy Harris dd152d81af Don't cast away constness.
svn path=/trunk/; revision=54769
2014-01-14 05:49:04 +00:00
Jörg Mayer 1242a77e74 Change level off TCP/RST expertitem from chat to warn. Add a comment
that RST is still an indicator for network errors/problems.

svn path=/trunk/; revision=54709
2014-01-13 10:51:37 +00:00
Jeff Morriss b20e6a20eb Make the SCTP Decode-As dialog more consistent with the TCP one.
Rename the 2nd SCTP Transport tab to "SCTP(PPID)" to make it obvious what it
is.

Fix up casing and code formatting in both SCTP and TCP Decode-As code.

svn path=/trunk/; revision=54391
2013-12-23 16:50:25 +00:00
Jakub Zawadzki e0e86bab5a Fix const warnings.
svn path=/trunk/; revision=54092
2013-12-14 14:33:46 +00:00
Anders Broman 138ce6f204 Try to fix "initializer element is not computable at load time"
svn path=/trunk/; revision=53962
2013-12-12 17:32:22 +00:00
Anders Broman 07c5bb3480 - Forward declaration of register functions.
svn path=/trunk/; revision=53930
2013-12-11 06:10:45 +00:00
Michael Mann 9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future.  And search/replace of a function name is easy enough to do.

The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As.

All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope().  All other dissectors were converted to using file_scope() which was the original scope for "proto" data.

svn path=/trunk/; revision=53520
2013-11-23 02:20:13 +00:00
Michael Mann 76ab93ea94 Provide "Decode As" functionality through dissectors themselves instead of the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450)
The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table.  When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog.

This patch includes just the dissector portion of the functionality (minus packet-dcerpc.[ch] because it has hooks to the current GUI)

svn path=/trunk/; revision=53445
2013-11-20 19:17:08 +00:00
Gerald Combs 190bdc32de Add packet information and selection to the Follow Stream dialog.
Collect packet numbers when following streams so that we can correlate
text positions with packets. Add a FollowStreamText class so that we can
track mouse events. Add a hint label that shows the packet under the
cursor along with packet counts and the number of "turns".

Add the packet number to the C array dump. Note that dumping to YAML
might be useful for Scapy users.

svn path=/trunk/; revision=53314
2013-11-14 17:37:40 +00:00
Evan Huus fc08bf1143 Fix what appears to be a mistake during the conversion in r53036 from
dissector_try_uint to dissector_try_uint_new: protocols called due to TCP port
matching were not getting added to the list of protocols in the frame. The
"add_proto_name" parameter should be TRUE except in unusual circumstances.

svn path=/trunk/; revision=53308
2013-11-13 23:43:08 +00:00
Gerald Combs 1d8a895fa4 Try using UTF8_RIGHTWARDS_ARROW to indicate direction.
If this doesn't cause any problems we should probably move
utf8_entities.h from ui to wsutil.

svn path=/trunk/; revision=53276
2013-11-12 17:34:50 +00:00
Michael Mann 5470356154 Remove tcp_tree from packet_info structure.
All dissectors that call tcp_dissect_pdus() have the same relative tree position, so it doesn't need to be specifically saved in the packet_info.

svn path=/trunk/; revision=53253
2013-11-11 19:30:59 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors.
Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that?

Should tcp_dissect_pdus return length (bytes consumed)?  There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb).  Seems like that could all be rolled into one.

svn path=/trunk/; revision=53198
2013-11-09 17:46:28 +00:00
Evan Huus 389423aaaa Replace pinfo->layer_names as a string with pinfo->layers as a wmem_list of
protocol IDs. This is substantially more efficient, which means we can build it
all the time rather than only if tree (in my benchmarks the extra time taken is
not large enough to be statistically significant even over tens of thousands of
packets).

This fixes what was probably a bug in btobex that relied on layer_names for
non-tree dissection. It also enables a much simpler fix for
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9303

svn path=/trunk/; revision=53089
2013-11-05 17:48:48 +00:00
Michael Mann f8f1f48371 Pass struct tcpinfo into all TCP subdissectors instead of through pinfo->private_data.
svn path=/trunk/; revision=53036
2013-11-02 00:36:30 +00:00
Michael Mann b6484432aa Allow try_conversation_dissector() to pass data to subdissectors.
svn path=/trunk/; revision=53035
2013-11-01 23:45:10 +00:00
Bill Meier 0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

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


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +00:00
Pascal Quantin debe9b6591 As reported by Didier Gautheron on -dev (http://www.wireshark.org/lists/wireshark-dev/201310/msg00159.html) :
Since r49923, TCP flags are no more displayed in info column when tree is NULL

svn path=/trunk/; revision=52597
2013-10-14 08:36:38 +00:00