Allow bigger snapshot lengths for D-Bus captures.
authorGuy Harris <guy@alum.mit.edu>
Mon, 5 Jun 2017 01:58:40 +0000 (18:58 -0700)
committerGuy Harris <guy@alum.mit.edu>
Mon, 5 Jun 2017 05:28:26 +0000 (05:28 +0000)
commitd0865fd619454a9ac06b1c7d287dc438aff50bb0
tree91efc24ec72d274b1529342041641b36939236f2
parent17965f57f178aa7e4027f2d363658098e2f1abb3
Allow bigger snapshot lengths for D-Bus captures.

Use WTAP_MAX_PACKET_SIZE_STANDARD, set to 256KB, for everything except
for D-Bus captures.  Use WTAP_MAX_PACKET_SIZE_DBUS, set to 128MB, for
them, because that's the largest possible D-Bus message size.  See

https://bugs.freedesktop.org/show_bug.cgi?id=100220

for an example of the problems caused by limiting the snapshot length to
256KB for D-Bus.

Have a snapshot length of 0 in a capture_file structure mean "there is
no snapshot length for the file"; we don't need the has_snap field in
that case, a value of 0 mean "no, we don't have a snapshot length".

In dumpcap, start out with a pipe buffer size of 2KB, and grow it as
necessary.  When checking for a too-big packet from a pipe, check
against the appropriate maximum - 128MB for DLT_DBUS, 256KB for
everything else.

Change-Id: Ib2ce7a0cf37b971fbc0318024fd011e18add8b20
Reviewed-on: https://code.wireshark.org/review/21952
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
84 files changed:
capture_opts.c
caputils/capture-pcap-util.c
cfile.c
cfile.h
dumpcap.c
epan/dissectors/packet-snort.c
epan/wslua/wslua_capture_info.c
file.c
rawshark.c
sharkd.c
summary.c
summary.h
text2pcap.c
tfshark.c
tshark.c
ui/capture_ui_utils.c
ui/commandline.c
ui/gtk/capture_dlg.c
ui/gtk/file_import_dlg.c
ui/gtk/gsm_map_summary.c
ui/gtk/mtp3_summary.c
ui/gtk/prefs_capture.c
ui/gtk/summary_dlg.c
ui/qt/capture_file_properties_dialog.cpp
ui/qt/capture_interfaces_dialog.cpp
ui/qt/compiled_filter_output.cpp
ui/qt/gsm_map_summary_dialog.cpp
ui/qt/interface_tree_cache_model.cpp
ui/qt/mtp3_summary_dialog.cpp
ui/tap_export_pdu.c
ui/text_import.h
wiretap/5views.c
wiretap/aethra.c
wiretap/ascendtext.h
wiretap/btsnoop.c
wiretap/camins.c
wiretap/capsa.c
wiretap/catapult_dct2000.c
wiretap/commview.c
wiretap/cosine.c
wiretap/csids.c
wiretap/daintree-sna.c
wiretap/dbs-etherwatch.c
wiretap/erf.c
wiretap/eyesdn.c
wiretap/file_access.c
wiretap/hcidump.c
wiretap/i4btrace.c
wiretap/ipfix.c
wiretap/iptrace.c
wiretap/iseries.c
wiretap/k12.c
wiretap/k12text.l
wiretap/lanalyzer.c
wiretap/libpcap.c
wiretap/logcat.c
wiretap/logcat_text.c
wiretap/merge.c
wiretap/mime_file.c
wiretap/mp2t.c
wiretap/netmon.c
wiretap/netscaler.c
wiretap/netscreen.c
wiretap/nettl.c
wiretap/nettrace_3gpp_32_423.c
wiretap/network_instruments.c
wiretap/netxray.c
wiretap/ngsniffer.c
wiretap/packetlogger.c
wiretap/pcap-common.c
wiretap/pcap-common.h
wiretap/pcapng.c
wiretap/peekclassic.c
wiretap/peektagged.c
wiretap/pppdump.c
wiretap/radcom.c
wiretap/snoop.c
wiretap/stanag4607.c
wiretap/tnef.c
wiretap/toshiba.c
wiretap/visual.c
wiretap/vms.c
wiretap/vwr.c
wiretap/wtap.h