Commit Graph

94 Commits

Author SHA1 Message Date
Gerald Combs 1d030928ef Remove some GTK+-only code.
Change-Id: Ic2498c7acd6a1a522be45094148402ee34a6b4d1
Reviewed-on: https://code.wireshark.org/review/26958
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-17 03:44:47 +00:00
Guy Harris 1f5f63f8ef Generalize wtap_pkthdr into a structure for packet and non-packet records.
Separate the stuff that any record could have from the stuff that only
particular record types have; put the latter into a union, and put all
that into a wtap_rec structure.

Add some record-type checks as necessary.

Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2
Reviewed-on: https://code.wireshark.org/review/25696
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-09 00:29:51 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Guy Harris 48e65c4af4 Hand the packet provider functions to epan_new().
Have separate packet_provider_data structures and packet_provider_funcs
structures; the latter holds a table of functions that libwireshark can
call for information about packets, the latter holds the data that those
functions use.

This means we no longer need to expose the structure of an epan_t
outside epan/epan.c; get rid of epan/epan-int.h.

Change-Id: I381b88993aa19e55720ce02c42ad33738e3f51f4
Reviewed-on: https://code.wireshark.org/review/24732
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-08 04:33:55 +00:00
Guy Harris 797d2f6a87 Move the frame_set stuff back into the capture_file structure.
libwireshark now expects an epan_t to be created with a pointer to a
"packet provider" structure; that structure is opaque within
libwireshark, and a pointer to it is passed to the callbacks that
provide interface names, interface, descriptions, user comments, and
packet time stamps, and that set user comments.  The code that calls
epan_new() is expected to provide those callbacks, and to define the
structure, which can be used by the providers.  If none of the callbacks
need that extra information, the "packet provider" structure can be
null.

Have a "file" packet provider for all the programs that provide packets
from a file.

Change-Id: I4b5709a3dd7b098ebd7d2a7d95bcdd7b5903c1a0
Reviewed-on: https://code.wireshark.org/review/24731
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-08 03:32:25 +00:00
Guy Harris ccc55bc80c Put the structure of a capture_file back in cfile.h.
The split isn't necessary now that epan no longer uses the capture_file
structure.

Change-Id: Ia232712a2fb5db511865805518e8d03509b2167f
Reviewed-on: https://code.wireshark.org/review/24693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:35:36 +00:00
Guy Harris 1834dca365 Move the parts of a capture_file used by libwireshark to a new structure.
Embed one of those structures in a capture_file, and have a struct
epan_session point to that structure rather than to a capture_file.
Pass that structure to the routines that fetch data that libwireshark
uses when dissecting.

That separates the stuff that libwireshark expects from the stuff that
it doesn't look at.

Change-Id: Ia3cd28efb9622476437a2ce32204597fae720877
Reviewed-on: https://code.wireshark.org/review/24692
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:02:18 +00:00
Guy Harris eb8ffb74e2 Use cfile.h to define the capture_file type.
Have cfile-int.h declare the structure, and use it in files that
directly access the structure.

Have cfile.h just incompletely declare the structure and include it
rather than explicitly declaring it in source files or other header
files.

Never directly refer to struct _capture_file except when typedeffing
capture_file.

Add #includes as necessary, now that cfile.h doesn't drag in a ton of

Change-Id: I7931c8039d75ff7c980b0f2a6e221f20e602a556
Reviewed-on: https://code.wireshark.org/review/24686
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-03 18:54:37 +00:00
Gerald Combs 28b6616ea0 Get rid of some void pointers.
Explictly struct _capture_file * in epan_session and its callbacks.

Change-Id: I63703015c661a08f3350a7448a7bcdaf98f119dc
Reviewed-on: https://code.wireshark.org/review/24675
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-01 21:09:24 +00:00
João Valverde 8fa4a440a8 GTK: Remove packet editor
Removes limited experimental feature for deprecated UI.

Change-Id: Ib3ccfae89dd2a674ebbde346a442fa1cf6587f26
Reviewed-on: https://code.wireshark.org/review/24563
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-24 05:13:42 +00:00
Gerald Combs 775bbbcded Start using SPDX license identifiers.
A while back Graham pointed out the SPDX project (spdx.org), which is
working on standardizing license specifications:

https://www.wireshark.org/lists/wireshark-dev/201509/msg00119.html

Appendix V of the specification describes a short identifier
(SPDX-License-Identifier) that you can use in place of boilerplate in
your source files:

https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b

Start the conversion process with our top-level C and C++ files.

Change-Id: Iba1d835776714deb6285e2181e8ca17f95221878
Reviewed-on: https://code.wireshark.org/review/24302
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-09 20:03:51 +00:00
Jeff Morriss bef90e1493 Update the capture file load time each time we update the progress bar.
The Qt UI doesn't have a popup that tells you how long your file has been
loading.  So let's set the load time each time we update the packets bar.

(Obviously this is only useful when you're waiting a long time for a file to
load...)

Change-Id: I9da372800a12454888439e2baf3d2a848c611501
Reviewed-on: https://code.wireshark.org/review/22234
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-19 23:49:24 +00:00
Guy Harris d0865fd619 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>
2017-06-05 05:28:26 +00:00
Jim Young 520a1b2066 Make the capture file's interface description filterable
This patch introduces the frame.interface_description field.

While testing this new functionality it became obvious that we have
a non-optimal interaction between the existing cfile.c's
cap_file_get_interface_name(), the recently added frame.interface_name
field and this new frame.interface_description field.

The string returned from cap_file_get_interface_name() may in fact
come from one of three different sources: the idb's interface name
(if it exists) or the idb's interface description (if that exists)
or a default text of "unknown".  The string ultimately becomes the
rame.interface_name whether or not the idb had an interface name
option to begin with.  This behavior does not allow one to test for
the simple presence of frame.interface_name.  The new peer function
cap_file_get_interface_description() added by this patch returns
NULL instead of "unknown" if the idb does not have an interface
description.  Should cap_file_get_interface_name() be similarly
modified to return NULL if the idb does not have an interface name?

Bug: 9781
Change-Id: Ie479f373c5080c004dd22bd88919838feca71e95
Reviewed-on: https://code.wireshark.org/review/19861
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-02-09 11:31:59 +00:00
Guy Harris e659faa3f7 Line up comments.
Change-Id: Ifda0499e00dfa38c936f7e054ab4d5b3a0fd627f
Reviewed-on: https://code.wireshark.org/review/15830
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-11 20:28:57 +00:00
Stig Bjørlykke b5ac91399c Qt: Select matching tree item and bytes in Find Packet
Highlight the matching tree item and matching packet bytes when
doing a Find Packet.  Added cf->search_len to correctly highlight
the matching bytes when doing a regex search.

Bug: 12157
Change-Id: I84fbdb9b43be4355e24aff3cf5f8850f1119e2bf
Reviewed-on: https://code.wireshark.org/review/14086
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-23 18:30:48 +00:00
Stig Bjørlykke 30d83e089c Qt: Add regex support in Find Packet
Add support for using regular expressions in the Search Frame
when searching in packet list, packet details and packet bytes.

This search is in many cases faster than plain string search.

Change-Id: I2d8a709046f90d7b278fb39547fc4e2e420623bc
Reviewed-on: https://code.wireshark.org/review/13981
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-18 08:06:46 +00:00
Gerald Combs 1dc608a05e Morph ProgressBar into CaptureProgressFrame.
Switch from a plain QProgressBar to a QFrame with a QProgressBar and a
stop button.

Add a stop_flag boolean to the capture_file struct.

To do:
- Start adding the progress bar to dialogs.
- Don't complain so loudly when the user stops a capture.

Change-Id: Iedd1d7d79f2044f1a53e4fb22186d25930a3ef03
Reviewed-on: https://code.wireshark.org/review/9029
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-23 06:06:37 +00:00
Gerald Combs 30ed6a1d72 Qt: Apply recent settings.
Add PacketList::applyRecentColumnWidths which set the packet list
column widths from our recent settings. Make sure it gets called at
startup and when we change profiles.

Save the packet list header state so that we can restore it when we
reset the model (i.e. freezing and thawing) and load a new capture file.
Save the state when the user resizes a column. As a side effect this
works around a weird bug that adjusts the width of column 1 at an
inopportune time.

Add a profileChanging signal so that we can save the main window geometry
in each profile.

Get rid of MainWindow::configurationProfileChanged. It was unused.

Apply saved pane widths and heights. Note that we might want to add a
separate pair of recent settings for the Qt panes.

Use the last opened directory in the capture file dialog.

Git rid of some unneeded Q_UNUSEDs while we're here.

Bug: 10953
Change-Id: I812aff59818cf0b4d1598b580627d32728d2e9d7
Reviewed-on: https://code.wireshark.org/review/7247
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-24 09:58:03 +00:00
Bill Meier bfe3706035 Always put editor-modelines at the end of the file ...
... to ensure that there are no potential issues with respect to
editors limiting the number of lines scanned at the end of the file
when checking for editor modelines.

Change-Id: Ic85cbb108bb5159d6ec4116fea11f5eebb4e44a4
Reviewed-on: https://code.wireshark.org/review/4688
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-14 20:08:29 +00:00
Bill Meier 1b8b2a8aa8 Add editor modelines; Adjust whitespace as needed.
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad
Reviewed-on: https://code.wireshark.org/review/4626
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-12 18:58:32 +00:00
Guy Harris a1b1c8bed5 Revert "Refactor Wiretap"
This reverts commit 1abeb277f5.

This isn't building, and looks as if it requires significant work to fix.

Change-Id: I622b1bb243e353e874883a302ab419532b7601f2
Reviewed-on: https://code.wireshark.org/review/1568
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09 05:21:01 +00:00
Michael Mann 1abeb277f5 Refactor Wiretap
Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality.

The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes.

bug:9607
Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae
Reviewed-on: https://code.wireshark.org/review/1485
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-09 03:04:39 +00:00
Hadriel Kaplan d1873dbcc8 Fix Bug 9903: 'Clicking reload-file ignores selected file format reader'
There's a relatively new feature in 1.11.3 to select a specific file format
reader, instead of relying on magics or heuristics. If you select a file
reader and open a file, open it, and then click the reload-file button or go
to View->Reload or press the ctrl-R keymap, the file is reloaded but using the
magic/heuristics again instead of the file format reader you previously chose.
Likewise, the Lua relaod() function has the same issue (which is how I found
this problem).

I have tested this change by hand, using a Lua script, but I didn't add it
to the testsuite because I need another change for my test script to work
correctly. (an enhancement rather than a bug fix, which I'll submit separately)

Change-Id: I48c2d9ea443e37fd9d41be43d6b6cd5a866d5b01
Reviewed-on: https://code.wireshark.org/review/764
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-21 17:51:45 +00:00
Anders Broman 0513b29b8b Revert "Allow pcapng interface options to be available to dissectors."
This patch causes Wireshark/tshark to segfault if the file is reread(open a file and press reload).
The test suite also fails on 
2.1.1 Step: Exit status for existing file: "/home/wireshark/builders/trunk/sol10sparc/build/test/captures/dhcp.pcap" must be 0/home/wireshark/builders/trunk/sol10sparc/build/test/suite-clopts.sh: line 149:  6646 Segmentation Fault      (core dumped) $TSHARK -r "${CAPTURE_DIR}dhcp.pcap" > ./testout.txt 2>&1

OSX build bot chokes on
pcapng.c: In function 'pcapng_destroy_option_value':
pcapng.c:377: warning: implicit declaration of function 'g_byte_array_unref'
pcapng.c:379: warning: implicit declaration of function 'g_array_unref'
pcapng.c: In function 'pcapng_collect_block_option':
pcapng.c:419: warning: implicit declaration of function 'g_byte_array_new_take'
pcapng.c:419: warning: initialization makes pointer from integer without a cast

these functions are glib 2.22
This reverts commit 7b13a3b0f6.

Change-Id: Ia82fdb2d08287bc2cd2841e1e941ae68cbc2e009
Reviewed-on: https://code.wireshark.org/review/749
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-20 12:25:21 +00:00
Christopher Kilgour 7b13a3b0f6 Allow pcapng interface options to be available to dissectors.
Interface options[1], and more generally pcapng options[2], are useful
information that can provide improved dissector output.

Prior to this change, only certain pcapng interface options were interpreted
and made available to dissectors, e.g. the interface name or description.
This change augments the situation by providing epan_get_interface_option( ),
which returns an array of byte arrays if the option code exists
(otherwise NULL).  Each element of the array is a byte buffer containing
the raw data of the option.  An array-of-buffers is used because pcapng
allows for multiple instances of the same option to be present in the file.
All interface options found in a pcapng file are thus made available to the
dissector.

The implementation also provides infrastructure to collect options from
other pcapng blocks such as the section header.  Currently these options
are discarded, but could be retained in the future to support more features.

[1] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionidb
[2] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionopt

Change-Id: I944b6f0f03dde9b8e7d1348b76acde6f9d312f37
Reviewed-on: https://code.wireshark.org/review/331
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-20 09:54:01 +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
Jakub Zawadzki 0f8572cb51 Avoid including definition of column_info structure in dissectors.
Move COL_* enum to <epan/column-utils.h>

XXX Later we can rename epan/column-info.h to column-int.h (or smth like this)

svn path=/trunk/; revision=54352
2013-12-22 10:41:27 +00:00
Jakub Zawadzki b75354ebe8 Avoid including <epan/epan.h> in dissectors.
svn path=/trunk/; revision=53774
2013-12-03 23:49:51 +00:00
Jakub Zawadzki 82e2675f45 Avoid including <wiretap/wtap.h> in dissectors.
svn path=/trunk/; revision=53655
2013-11-29 20:53:00 +00:00
Jakub Zawadzki 4eefe7c5a1 Remove comment & defines for frame_data_sequence from cfile.h
It's already in epan/frame_data_sequence.c and no-one else should use it.

svn path=/trunk/; revision=53341
2013-11-15 18:12:24 +00:00
Guy Harris cbda96d79a Global variables considered harmful.
svn path=/trunk/; revision=51352
2013-08-14 04:14:36 +00:00
Jakub Zawadzki 08eb36b5af Remove fdata->opt_comment, add pkt_comment to pinfo
Original (read from file) comments can be accessed by pkthdr->opt_comment
Keep user comments in seperated BST, add new method for epan session to get it.

svn path=/trunk/; revision=51090
2013-08-01 20:59:38 +00:00
Jakub Zawadzki 7ec1a78fe8 Abuse epan_t more: add callback to get interface name.
svn path=/trunk/; revision=50794
2013-07-22 19:38:38 +00:00
Jakub Zawadzki 28e9dcc4a9 Some work on multi file dissection
- make init_dissection/cleanup_dissection private for libwireshark
- implement epan_new(), epan_free()
- pass epan_t to epan_dissect*

svn path=/trunk/; revision=50761
2013-07-21 18:38:03 +00:00
Jeff Morriss 45449ce1a8 Move some more modules into epan.
svn path=/trunk/; revision=50517
2013-07-11 23:57:11 +00:00
Guy Harris 8c9edf1280 Have the seek-read routines take a Buffer rather than a guint8 pointer
as the "where to put the packet data" argument.

This lets more of the libwiretap code be common between the read and
seek-read code paths, and also allows for more flexibility in the "fill
in the data" path - we can expand the buffer as needed in both cases.

svn path=/trunk/; revision=49949
2013-06-16 00:20:00 +00:00
Evan Huus 2fba8c0f9d Update -2, -R and -Y to behave consistently as per the concensus reached on
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8223

Mention the new -Y flag and associated changes in the release notes.

svn path=/trunk/; revision=48654
2013-03-30 15:38:03 +00:00
Gerald Combs 5c2c5aed87 Rename the search type menu items to more accurately reflect what we're
actually doing and what users are likely to want to do.  Rename the
search enum values and functions to reflect what we're actually doing
and add a comment explaining why making searches more correct might make
searching worse.  Add a search bar to the Qt main window, thus
continuing the War On Gratuitous Dialogs.

Clear out any previous temporary label stack items before adding a new one.

svn path=/trunk/; revision=46541
2012-12-15 01:04:39 +00:00
Jakub Zawadzki 78631020b8 Add wtap_pseudo_header union to wtap_pkthdr structure.
Use pkthdr instead of pseudo_header as argument for dissecting.

svn path=/trunk/; revision=45601
2012-10-16 21:50:57 +00:00
Gerald Combs 71ed773862 Add a capture_file * element to packet_range_t and pass it explicitly in
packet_range_init(). Get rid of global cfile references in
packet-range.c. C++-ize packet-range.h. Shuffle some includes around.

svn path=/trunk/; revision=45333
2012-10-05 18:52:42 +00:00
Jakub Zawadzki 99e665dcd4 Revert r45183:r45184
r45182 was good fix, but updae frames_count when redissecting.

svn path=/trunk/; revision=45189
2012-09-28 10:08:17 +00:00
Jakub Zawadzki bd26485af1 Missing part of r45183
svn path=/trunk/; revision=45184
2012-09-27 21:20:27 +00:00
Jakub Zawadzki 78019edc99 cinfo.columns_changed is only used by ui/gtk, move it to cfile structure.
svn path=/trunk/; revision=44750
2012-09-03 15:12:49 +00:00
Gerald Combs 0da59a0058 Pass {delayed_}create_progress_dlg a pointer the top level window
so that we can properly associate a widget with create, update, and
destroy events. Only used by Qt so far but it should be easy enough to
add to GTK+.

Rename ui/qt/progress_dialog.{h,cpp} to progress_bar.{h,cpp}. Show a
progress bar in the status bar of the main window instead of creating
a separate dialog. Note that we still need to add a "cancel" mechanism
and display the task and item titles somewhere.

Thus began the War Against Gratuitous Dialogs.

svn path=/trunk/; revision=43833
2012-07-19 21:49:52 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Guy Harris 06474b4330 If the file has an SHB comment or any packet comments, and the user
tries to do "Save As" in a format for which we don't support comments
(currently, we only support them for pcap-ng), ask whether they want to
discard the comments and save anyway or, *if* the file can be saved in a
format for which we *do* support comments, they want to save the file in
some other format.

Keep a count of packet comments so that we don't have to scan all the
frame_data structures to determine whether we have any comments.

svn path=/trunk/; revision=43392
2012-06-20 01:11:01 +00:00
Guy Harris d1128f6433 For a capture file, keep an array of all encapsulation types seen.
Show all of them in the summary dialog; we will be using it in the
future to figure out what capture file formats we can write to (just
because a capture file format supports per-packet encapsulations, that
doesn't mean that it supports *all possible* encapsulations).

svn path=/trunk/; revision=43278
2012-06-15 23:54:05 +00:00
Guy Harris cf6d9841e3 Keep track, in Wiretap, of whether the file is compressed, and provide
an API to fetch that.

When doing "Save" on a compressed file, write it out compressed.

In the Statistics -> Summary dialog and in capinfos, report whether the
file is gzip-compressed.

svn path=/trunk/; revision=42818
2012-05-24 05:05:29 +00:00
Guy Harris 4a9b825c49 Change the "user_saved" member of a capture_file structure to
"unsaved_changes", and have it be TRUE iff changes have been made to the
file since it was read - *not* if it's a temporary file from a live
capture.

Check the "is_tempfile" member, and the "unsaved_changes" member, when
appropriate.

Just have a set_toolbar_for_capture_file() routine that updates the
"save", "close", and "reload" toolbar as appropriate, given a
capture_file structure - absorb the function of
set_toolbar_for_unsaved_capture_file() into it.

svn path=/trunk/; revision=42721
2012-05-20 08:56:06 +00:00