Commit Graph

37 Commits

Author SHA1 Message Date
Dario Lombardo 2e9f3c5d36 tap: change glib functions to wmem.
Change-Id: I878ae6b121a669f9b7f4e1e57bc079f0cb44c0bf
Reviewed-on: https://code.wireshark.org/review/15270
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-17 15:38:03 +00:00
Michael Mann 2d095de053 Move Gateway Control Protocol (Context Tracking) into packet-h248.h
The Gateway Control Protocol (Context Tracking) is used by both H248
and MEGACO, so the functionality was refactored to epan, but should
really be kept in the dissector directory to minimize (and eventually
completely remove) the epan directory's dependence on it.

Change-Id: I387b46aecde97234086bfdb7d8c546854fa301cd
Reviewed-on: https://code.wireshark.org/review/15798
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-12 11:21:52 +00:00
Guy Harris 24f02dafcd Add checks to address setting routines.
Fail if:

	1) you have an AT_NONE address with data;

	2) you have a non-AT_NONE address with a zero length and a
	   non-null data pointer, or with a non-zero length and a null
	   data pointer.

When comparing addresses for equality, just make sure the types are the
same, the lengths are the same and, if the lengths are non-zero, the
data is the same; don't treat AT_NONE specially - the "lengths are
non-zero" check will make sure we do the right thing.

Make sure when we create an AT_NONE address it has a zero length and
null data pointer.

Change-Id: I5c452ef0d140c2d9aef3004f1cfd124a95b78fb2
Reviewed-on: https://code.wireshark.org/review/15839
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-12 01:59:54 +00:00
Joerg Mayer 7e5dae90d6 Fix warnings/errors of type -Wused-but-marked-unused
Change-Id: I34c2d9953272822da0745d1b24c64d8466e43b37
Reviewed-on: https://code.wireshark.org/review/14668
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-28 13:27:52 +00:00
Pascal Quantin d9c274bebf Add IAX2 and Skinny calls to VoIP calls window
Bug: 12254
Change-Id: Ibaddfaf8018be673d8f2cf642b1127062d7d507d
Reviewed-on: https://code.wireshark.org/review/14423
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>
2016-03-11 17:48:22 +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 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
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
Guy Harris a7f470fa24 More pinfo->fd->abs_ts to pinfo->abs_ts.
Change-Id: I70db0a345cc4c5c57c454371deb4f92f9ac4b9ac
Reviewed-on: https://code.wireshark.org/review/13501
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23 03:58:56 +00:00
Pascal Quantin afaf929d0d Qt: various fixes to VoIP calls / RTP player windows
- Flush any remaining tapped packets before emitting captureFileRetapFinished().
  This ensures that all packets have been treated before returning from retapPackets().
- Remove VoIP tap listeners when captureFileRetapFinished() is emitted.
  This avoid summing stats each time the RTP player is opened, leading to wrong
  information in VoIP calls window
- Change voip_calls_tapinfo_t redraw member from a boolean to bitmap so as to identify
  which tap should call the tapinfo->tap_draw() callback. This allows fixing a race condition
  where the RTP player can be empty in Qt UI
- Reset some more statistics in voip_calls_reset_all_taps()

Change-Id: Ie7681702c81d338185c1813f2d340a437edf3a04
Reviewed-on: https://code.wireshark.org/review/12474
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: Anders Broman <a.broman58@gmail.com>
2015-12-09 16:54:33 +00:00
Pascal Quantin 8c46a728fe VoIP: fix a null dereference when trying to retrieve the time of a T.38 tapped packet
Rather than trying to retrieve frame_data from the packet number row (while it could be filtered) let's use pinfo.

Bug: 11596
Change-Id: I53966bfdfbeb0c5918c3524f4b9748ea425fe8a5
Reviewed-on: https://code.wireshark.org/review/12103
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>
2015-11-24 17:09:35 +00:00
Pascal Quantin 2773596970 Qt: add a reference counter to sequence analysis info
Increment the reference counter each time a flow sequence window is opened.
Free seq_analysis_info_t structure once the last flow sequence / VoIP calls / SIP flow window is closed.

Bug: 11712
Change-Id: I20fcb922b0516417d4bd74cdf75475dcb31f8b90
Reviewed-on: https://code.wireshark.org/review/11851
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-11-16 09:56:46 +00:00
Pascal Quantin 9df0b8f525 VoIP Calls: fix SIP calls state
A request other than INVITE (like ACK for example) is not a call setup

Change-Id: I2e78ed0163822a278b82e250e78aa91e673404cf
Reviewed-on: https://code.wireshark.org/review/11466
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-01 08:26:28 +00:00
Pascal Quantin adc7bfe71d voip_calls.c: add missing tap_draw callback to taps asking for a redraw
Otherwise the GUI does not get populated properly

Change-Id: I5e24ac5ab2909f3200c588405dbdc9c6bbb82a73
Reviewed-on: https://code.wireshark.org/review/11465
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-01 08:26:07 +00:00
Pascal Quantin 1ea43c26e6 Only store frame number and not a pointer to frame_data structure in seq_analysis_item_t
Qt GUI allows to keep windows open after closing the capture file. Let's not access to freed memory.

Bug: 11573
Change-Id: I9e70d818a4b228af319961ec512b6b9725792477
Reviewed-on: https://code.wireshark.org/review/11270
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-26 23:57:51 +00:00
Pascal Quantin e2203f5aed Qt: fix memory leaks in VoIP calls window
- Add free of h245_labels to voip_calls_remove_all_tap_listeners() so that memory is not leaked with Qt GUI
- Call voip_calls_reset_all_taps() from VoipCallsDialog destructor so as to free allocated memory

Change-Id: I46945b5d475d8c1267819021a4ed2782c531a0c6
Reviewed-on: https://code.wireshark.org/review/11268
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>
2015-10-26 11:06:51 +00:00
Guy Harris fb72cad4e8 Allocate h245_labels when we initialize the h245dg tap.
Otherwise, it might not exist at the time we try to use it.  (Yes,
reproducible if you download

	https://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=get&target=h223-over-rtp.pcap.gz

load it into Wireshark and, at least in the Qt UI, select Telephony ->
VoIP Calls - crashes every time on my Mac running Yosemite.)

Change-Id: Iacf5b8ef7fb5749dabeb5fc33d3494b5fc073c03
Reviewed-on: https://code.wireshark.org/review/11277
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-26 09:44:09 +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 d9e530bc17 Use address functions instead of ADDRESS macros in ui.
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the ui directory.

Change-Id: I10e95e66c8da5b880133452ebc484c53046e87ba
Reviewed-on: https://code.wireshark.org/review/11199
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:46:12 +00:00
Gerald Combs 3687d39304 Qt: Initial RTP playback.
Note the "initial". This is woefully incomplete.  See the "to do" lists
below and in the code.

This differs a bit from the GTK+ version in that you specify one or more
streams to be decoded.

Instead of showing waveforms in individual widgets, add them all to a
single QCustomPlot. This conserves screen real estate and lets us more
easily take advantage of the QCP API. It also looks better IMHO.

Change a bunch of checks for QtMultimediaWidgets to QtMultimedia. We
probably won't use the widgets until we make 5.0 our minimum Qt
version and plain old QtMultimedia lets us support Qt 4 more easily
(in theory at least).

Add resampling code from libspeex. I initially used this to resample
each packet to match the preferred rate of our output device, but this
resulted in poorer audio quality than expected. Leave it in and use to
create visual samples for QCP and to match rates any time the rate
changes. The latter is currently untested.

Add some debugging macros.

Note that both the RTP player and RTP analysis dialogs decode audio data
using different code.

Note that voip_calls_packet and voip_calls_init_tap appear to be dead
code.

To do:

- Add silence frames where needed.
- Implement the jitter buffer.
- Implement the playback timing controls.
- Tapping / scanning streams might be too slow.

Change-Id: I20dd3b66d3df53c9b1f3501262dc01458849f6b4
Bug: 9007
Reviewed-on: https://code.wireshark.org/review/10458
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-02 18:26:05 +00:00
Pascal Quantin 9defa0fc18 GTK/Qt: fix crash when closing SIP Flows dialog
Bug: 11500
Change-Id: Ifc3826c9743b0fab338cc85c9210231320feddf2
Reviewed-on: https://code.wireshark.org/review/10384
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>
2015-09-04 18:24:27 +00:00
Michal Pazdera c711a63e48 Avoid duplicate SIP and Q.931 calls in VoIP Calls list in case of Q.931
transported over SIP as described in RFC 3204, 3.2 QSIG Media Type.

Change-Id: Ida30a7b115e60fa64d30cfc1f4b7c11be724f8ee
Reviewed-on: https://code.wireshark.org/review/9479
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-26 07:32:34 +00:00
Pascal Quantin 1ec868eddd Fix a few issues reported by PVS-Studio
See http://www.viva64.com/en/b/0328/ for details

Change-Id: Ic9ddfd690b49401c96cb8a4a277c671f9824be31
Reviewed-on: https://code.wireshark.org/review/8775
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-05 21:15:37 +00:00
AndersBroman 6d1b6f4692 [VoIP] There has to be two separate routines for MEGACO and H248 as
tap_id_offset is used to access tapinfo. Fixes a crash rported in

Bug: 11132
Change-Id: I32ada3e0eb16d0e128ff67c5aec499890602eab0
Reviewed-on: https://code.wireshark.org/review/8449
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-13 11:31:31 +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
Michael Mann 90a76e0d51 Convert val_to_str -> val_to_str_wmem.
This is mostly for GUI usage, but a few dissectors needed some "non-packet scope" conversions.

val_to_str officially now uses wmem_packet_scope()

Change-Id: Ic9413eeb3406d7a7683222b86709f3675d628d81
Reviewed-on: https://code.wireshark.org/review/6933
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-04 06:58:49 +00:00
Michael Mann b635997624 Convert val_to_str_ext -> val_to_str_ext_wmem for calls that don't have valid packet scope (GUI).
val_to_str_ext now officially uses wmem_packet_scope().

Removed const from val_to_str[_ext]_wmem return value since it's not really constant.

Created utility functions in qt_ui_utils.h to help with the new memory management for its GUI.

Change-Id: Idf2ce4a4ce78d628b2269ad23a3a48fbfc9c077c
Reviewed-on: https://code.wireshark.org/review/6926
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-03 13:03: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
Martin Mathieson 43f09e67b4 Remove unneeded includes from ui folder
Change-Id: Ifd1eebff9080cd3867e44e4dcb2d2681370ed60a
Reviewed-on: https://code.wireshark.org/review/6128
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-01-01 23:11:10 +00:00
Alexis La Goutte 9c7c72d5f2 VoIP Calls: Missing break in switch (CID 1155515)
Change-Id: Ie62cd2901c791490fe6685f560815e09b921d03b
Reviewed-on: https://code.wireshark.org/review/6001
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-25 21:11:22 +00:00
Gerald Combs 2bb8255e29 Consolidate RTP stream structs.
Consolidate the three different RTP stream structs in ui/rtp_stream.h,
ui/gtk/rtp_player.c, and ui/voip_calls.c into one. Make the member names
a bit more consistent. Document what each GList contains. Use nstime_t
for timestamps since that's what we get from the frame data. Use g_new0
to initialize our structs.

Change-Id: I2b3f8f2051394a6a98a5c7bc49c117f07161d031
Reviewed-on: https://code.wireshark.org/review/5843
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-20 16:49:05 +00:00
Gerald Combs 2ebaa59a3b Consolidate sequence analysis code.
Move scattered code for seq_analysis_info_t creation and destruction to
tap-sequence-analysis.[ch].

Change-Id: I87c14b1c83105a48d0ab149a3abba71e2a2fe21f
Reviewed-on: https://code.wireshark.org/review/5479
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-11-26 00:04:05 +00:00
Gerald Combs 06dc2a7537 voip_calls: Fix tap callbacks.
We don't need to call the VoIP tap reset and draw callbacks repeately.
Do so only once from the RTP tap. Packet callbacks should return a
gboolean.

Clean up some function names and make some static.

Change-Id: I5c934ce8ce7f279861e8cc73235bbfc27d7fe622
Reviewed-on: https://code.wireshark.org/review/5396
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-11-19 17:14:52 +00:00
Gerald Combs cfa0e5fd53 voip_calls: Regression fixes.
Fix struct initialization logic. Clear a GQueue instead of deleting it.
Don't crash if we have no sequence diagram items. Make sure we show all
flows and not just invites. Zero allocated memory in a couple of places.

Change-Id: Ia5bb3ba57cf625de4b554b354e098aa0361dff28
Reviewed-on: https://code.wireshark.org/review/5390
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-11-18 23:37:35 +00:00
Gerald Combs 1dec509a88 voip_calls: Move to ui.
Move voip_calls.[ch] to ui. Add callbacks to voip_calls_tapinfo_t.
Remove unused function definitions.

Change-Id: Ib12db7053d53afa81ef2a66dc0cfe681bc624dd2
Reviewed-on: https://code.wireshark.org/review/5379
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-11-18 00:48:34 +00:00