Commit Graph

46 Commits

Author SHA1 Message Date
Eugene Adell ba28616ff5 TCP: Conversations Statistics loyalty to connections initiators
Conversations Statistics suggested the connection initiator was
Address A because of an address/port comparison, when the packet
list says it was Address B. This behavior is changed then the
conversations statistics now suggest the real initiator. Exporting
data from these statistics allow a loyal re-processing.
Closes #16919.
2021-02-21 13:12:35 +00:00
Guy Harris 97a168747f Move some variables inside the block where they're used.
They're not used outside a block, so move them inside the block.  Also,
they're set before they're used, so don't initialize them when they're
declared.

This should squelch some unreadVariable warnings from cppcheck.
2021-01-20 00:14:19 -08:00
Guy Harris 8322c5e210 Get rid of a GTK+-only field.
Change-Id: Iab68aaf0507fc94ff85deaf41c8ee23818d568c1
Reviewed-on: https://code.wireshark.org/review/27573
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16 08:16:15 +00:00
Dario Lombardo 55c68ee69c epan: use SPDX indentifiers.
Skipping dissectors dir for now.

Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa
Reviewed-on: https://code.wireshark.org/review/25694
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 19:29:45 +00:00
Michael Mann 63966ec5d5 Use endpoint_type in conversation tables and hostlists
Follow up to having conversions use endpoint_type instead of
port_type.

Change-Id: Ifd59a33bd8b9a013c242bce5fcceb09533f02c17
Reviewed-on: https://code.wireshark.org/review/24172
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-29 20:17:03 +00:00
Pascal Quantin a8ce98fc25 Fix endpoints statistics optional filter parsing
Bug: 13538
Change-Id: I4cd66d2dffc976610d41126c50b5722bc06a72f8
Reviewed-on: https://code.wireshark.org/review/20810
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Christopher Maynard <Christopher.Maynard@gtech.com>
2017-03-31 19:25:20 +00:00
Michael Mann 56aaa5b705 Switch conversations to use wmem_tree_t instead of (sorted) GSList.
Change-Id: Ifaf25ca5a7974f1d398ceebbb4c6733d4d3e001a
Reviewed-on: https://code.wireshark.org/review/20006
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-06 11:41:54 +00:00
Dario Lombardo e2951a2ca8 stat_tap_ui: remove leaks.
Change-Id: If7a28ba305bed9f63f200f8a8a27a796f2df9c07
Reviewed-on: https://code.wireshark.org/review/20015
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-19 13:25:44 +00:00
Dario Lombardo 9a47f5cd19 conversation_table: replace g_string with wmem allocated string.
Change-Id: I54402822ee24214d13e052c0379514a39de16980
Reviewed-on: https://code.wireshark.org/review/19944
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-04 01:35:26 +00:00
Dario Lombardo d020990f03 conversation_table: add cleanup function.
Change-Id: Icea963384c16b1ad5387a885219d0621b470181b
Reviewed-on: https://code.wireshark.org/review/19699
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-21 00:27:25 +00:00
Michael Mann e7b78eb0a6 Move AT_USB to inside USB dissector.
This required some hacking in the conversation table handling, but
still seemed worth it as USB address is not widely used.
Maybe a "is_stringlike" property for address types...

Change-Id: I628a15c17cb1f595bb292130867adbc5bea0f41a
Reviewed-on: https://code.wireshark.org/review/16068
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-22 04:57:43 +00:00
João Valverde e4c059f67f Add free_address_wmem(), fix warnings [-Wcast-qual]
Try to improve address API and also fix some constness warnings
by not overloading the 'data' pointer to store malloc'ed buffers
(use private pointer for that instead).

Second try, now passing test suite.

Change-Id: Idc101cd866b6d4f13500c9d59da5c7a38847fb7f
Reviewed-on: https://code.wireshark.org/review/13946
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-26 23:09:43 +00:00
João Valverde 82bb9ebc01 Add some casts to void * to fix (pedantic) argument mismatch notes
Change-Id: I63e46285b4c6676d4ae57196b85fbad89964898c
Reviewed-on: https://code.wireshark.org/review/13933
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-15 00:00:34 +00:00
João Valverde ef929dc8eb Revert "Add free_address_wmem() and other extensions to address API"
This reverts commit 13ec77a9fc.

This commit introduces a segmentation fault for Lua code (uncovered by the test suite).

Change-Id: Ibc273d1915cda9632697b9f138f0ae104d3fb65e
Reviewed-on: https://code.wireshark.org/review/13813
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-08 00:44:22 +00:00
João Valverde 13ec77a9fc Add free_address_wmem() and other extensions to address API
Try to improve 'address' API (to be easier/safer) and also avoid
some constness warnings by not overloading the 'data' pointer to
store malloc'ed buffers (use private pointer for that instead).

Change-Id: I7456516b12c67620ceadac447907c12f5905bd49
Reviewed-on: https://code.wireshark.org/review/13463
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-07 23:22:30 +00:00
Guy Harris 099698445b Move the proto data stuff out of frame_data.[ch].
It's not tied to the frame_data structure any more, so it belongs by
itself.

Clean up some #includes while we're at it; in particular, frame_data.h
doesn't use anything related to tvbuffs, so don't have it gratuitiously
include tvbuff.h.

Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c
Reviewed-on: https://code.wireshark.org/review/13518
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-25 02:24:34 +00:00
João Valverde 4dd3f668dc Avoid returning malloced memory as const [-Wcast-qual]
Change-Id: I0b2c03cbde963d13d07ef13284d85b922eec3be9
Reviewed-on: https://code.wireshark.org/review/13439
Reviewed-by: João Valverde <j@v6e.pt>
2016-01-21 02:30:18 +00:00
Guy Harris c2b7743264 Eliminate more unnecessary casting away of constness.
Change-Id: I3d2d83d60f798703ea3fa16ba2d6e95a00f88469
Reviewed-on: https://code.wireshark.org/review/12885
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-28 20:46:26 +00:00
Evan Huus cda450ed59 Fix address hashing broken in g4f39c60
We actually have to *use* the return value of the method, which the macro did
for us.

Change-Id: I240ca7e526a18054fe39c6c4ded902998dc2fef0
Reviewed-on: https://code.wireshark.org/review/12389
Petri-Dish: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-12-03 02:00:18 +00:00
Gerald Combs 4f39c603c2 More ADDRESS macro to address function conversions.
Replace remaining calls to SET_ADDRESS, CMP_ADDRESS, ADDRESSES_EQUAL,
COPY_ADDRESS, and COPY_ADDRESS_SHALLOW with their lower-case
equivalents.

Replace all ADD_ADDRESS_TO_HASH calls with add_address_to_hash.

Change-Id: I4cff857d7a84085abe0bccd52d2605d2a468bf6f
Reviewed-on: https://code.wireshark.org/review/11229
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-24 01:44:24 +00:00
Gerald Combs 86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:45:56 +00:00
Michael Mann 6de6f7f0f8 Further refactor SRT stats.
Create "common" SRT tap data collection intended for all GUIs.   Refactor/merge functionality of existing dissectors that have SRT support (AFP, DCERPC, Diameter, FC, GTP, LDAP, NCP, RPC, SCIS, SMB, and SMB2) for both TShark and GTK.

SMB and DCERPC "tap packet filtering" were different between TShark and GTK, so I went with GTK filter logic.
CAMEL "tap packet filtering" was different between TShark and GTK, so GTK filtering logic was pushed to the dissector and the TShark tap was left alone.

Change-Id: I7d6eaad0673fe628ef337f9165d7ed94f4a5e1cc
Reviewed-on: https://code.wireshark.org/review/8894
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-21 03:35:13 +00:00
Guy Harris 5e67ae78ba Get rid of an unused structure member.
Change-Id: I2941bb7e6dc0fce3e1256af6e5e19d2997de5801
Reviewed-on: https://code.wireshark.org/review/7573
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-07 04:41:09 +00:00
Bill Meier 9c866ff971 Replace tabs by spaces when editor modelines has "expandtab"
Change-Id: If7a6f2697be732ae4f94ed8b845fd293c32510f7
Also: tabs-stops should be 8
Reviewed-on: https://code.wireshark.org/review/7100
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-13 17:34:53 +00:00
Guy Harris 233dc643a6 Remove some apparently-unnecessary includes of emem.h.
Change-Id: Id50ce3e707056cca8f30052f05c451ce431b39b5
Reviewed-on: https://code.wireshark.org/review/6632
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 19:36:36 +00:00
Alexis La Goutte c610c38b6f Conversation Table : Copy-paste error (CID 1262415)
Change-Id: I37fd8154f93763ac091528921d1b66d8e8fd56dd
Reviewed-on: https://code.wireshark.org/review/6555
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-15 19:23:32 +00:00
Guy Harris 63a3d043e3 Consistently use the "g_string_free returns a C string pointer" idiom.
g_string_free(str, FALSE) frees the GString container but not the
underlying g_malloc()ed string; instead, it returns a pointer to the
g_malloc()ed string.

Fix those places that didn't already get the string pointer from
g_string_free() to do so rather than manually extracting the string
themselves.

And fix one place that didn't even need to use a string - it was just
scanning a C string without even modifying it.

Change-Id: Ibbf4872bf5b9935b9907f539b6edb1013f3053a5
Reviewed-on: https://code.wireshark.org/review/6532
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13 23:14:13 +00:00
Michael Mann 14cad60f7d Remove ep_ allocated memory from get_conversation_filter and just return a g_alloced string.
Change-Id: Ie7f6b2c5479fec1a44afb5e446ef6abf304113af
Reviewed-on: https://code.wireshark.org/review/6480
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-10 19:58:21 +00:00
Michal Labedzki 7177cedc26 USB: Fix Conversation/Endpoint filters
There were not fields for that, so simple add them.

Change-Id: I489bae24ac96ea0baf395add731f4d62ccf19352
Reviewed-on: https://code.wireshark.org/review/6401
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-01-10 15:34:24 +00:00
Michal Labedzki 0078211c84 Add quotation marks in Conversations/Endpoints when address is string
Change-Id: I39d49542cd563db1f6d3423b4e382a9a5e1c801b
Reviewed-on: https://code.wireshark.org/review/6398
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-01-08 13:45:11 +00:00
Michael Mann 2209678149 ep_<protocol>_port_to_display -> <protocol>_port_to_display
Adjust any other ep_ related APIs related to the transition.

Change-Id: I961b371c2c4bda557e0f1817705c27eef0dae66c
Reviewed-on: https://code.wireshark.org/review/6388
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 05:32:32 +00:00
Michael Mann 55de46f317 Replace ep_address_to_str with address_to_str.
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b
Reviewed-on: https://code.wireshark.org/review/6323
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-06 07:38:18 +00:00
Michael Mann 22b4ec91c0 Replace ep_display_to_address with wmem equivalent display_to_address.
Almost all instances require using "manual" memory management, but it gets some ep_ calls out of the GUI.

Change-Id: Ifa7303766b08d09442ccf3d7063cbe061578ecd9
Reviewed-on: https://code.wireshark.org/review/6318
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-05 13:55:04 +00:00
Michael Mann 860cb393d8 tshark: Add endpoints statistics
"stat name" has been official changed to "endpoints" for all dissectors, rather than a mixture of "host"/"endpoints" based on dissector.

Change-Id: If34bcb5165b493948e784ba038ab202803a59843
Reviewed-on: https://code.wireshark.org/review/6154
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-02 00:02:18 +00:00
Pascal Quantin c34c2a61d0 Fix conversations filtering
Change-Id: Ic615830a373deab349a0a5a62f25b131e0bcbf18
Reviewed-on: https://code.wireshark.org/review/6162
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-31 14:35:07 +00:00
Pascal Quantin 84110d2981 tshark: endpoints statistics are not supported for now, do not list them in -z
Move statistics registration to "GUI" callback registration

Change-Id: Id27c049dc8f91d311e9231342ae40749ca0ff5fc
Reviewed-on: https://code.wireshark.org/review/6151
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-31 04:24:18 +00:00
Guy Harris eb93f3bdfb Don't do unsafe pointer casting
Don't cast a pointer-to-int into a pointer-to-pointer and pass the
resulting pointer to g_hash_table_lookup_extended() - pointers and ints
are *not* guaranteed to be the same size.  Instead, just have a variable
of type gpointer, pass a pointer to *that*, and then run that result
through GPOINTER_TO_UINT().

This fixes a reproducible crash.

Change-Id: I42954f222ab59866cb909b80d9dbb1d2668d2aff
Reviewed-on: https://code.wireshark.org/review/5457
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-24 01:04:20 +00:00
Guy Harris 4d3c4c4f12 Rename stat_cmd_args.[ch] to stat_tap_ui.[ch].
The intent is to handle more than just command-line arguments; reflect that.

Change-Id: Ia10efda85a9d11c6579d1bec6f789cee30d9e825
Reviewed-on: https://code.wireshark.org/review/5304
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-14 18:52:06 +00:00
Guy Harris a21436eaed tap_ui -> stat_tap_ui.
The old routine had stat_ in the name, as the expectation was that they
were for statistics taps; that's still the expectation, so have stat_ in
the data structure and routine names.

Change-Id: Ic98d011012b8641173d41fa0ec4f4e625614370a
Reviewed-on: https://code.wireshark.org/review/5303
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-14 18:42:50 +00:00
Guy Harris 7390516f61 For tap UIs, register a list of parameters and some menu information.
The intent here is to centralize more UI information so that we can move
more tap UI stuff to common code.  This is a beginning.

Change-Id: Ic35ac0c01bc7b942aab88177db4065847a5e6c30
Reviewed-on: https://code.wireshark.org/review/5301
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-14 18:31:34 +00:00
Bill Meier a379ac74d2 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: Ia6c3e7a25615bf8e052c3bacf096d76df775c9c2
Reviewed-on: https://code.wireshark.org/review/4126
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 15:31:58 +00:00
Alexis La Goutte caf73525f3 Fix parameter 'key' not found in the function declaration (-Wdocumentation)
Change-Id: Ie7f3e192d8980968da15921a8497153506df1fde
Reviewed-on: https://code.wireshark.org/review/3903
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-31 16:55:28 +00:00
Michael Mann 018b84de84 Refactor "common" hostlist/endpoint table functionality.
This is very similar in architecture to the changes made to the Conversation table functionality.  Since all conversations have endpoints/hostlists, the "registered" list is shared for both.

Change-Id: Ie8c6910a68a1b3f27c5b18c4494f49b9404a7b31
Reviewed-on: https://code.wireshark.org/review/3214
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-18 04:24:39 +00:00
Bill Meier f3dd7fe1eb Fix whitespace/indentation to match editor modelines.
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca
Reviewed-on: https://code.wireshark.org/review/3452
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-05 20:42:21 +00:00
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