Commit Graph

92 Commits

Author SHA1 Message Date
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
Gerald Combs 083ea63f10 Add a cast.
Change-Id: Ib1885bcbe061942ecba55b90e6b1d9b20f033f41
Reviewed-on: https://code.wireshark.org/review/505
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-03-04 19:18:48 +00:00
Michal Labedzki 6a4049535a win32: Implement format type selector in open file dialog
Change-Id: Idef1829fcc2b7b08783e5288bb6486ce19c4779b
Reviewed-on: https://code.wireshark.org/review/405
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-04 18:31:48 +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
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Michal Labedzki 579e7e19ce Wireshark: Add option to choose format type of capture file
The best heuristic can fail, so add possibility to manually choose
capture file format type, so not correctly recognize file format can be
loaded in Wireshark.

On the other side now it is possible to open capture file
as file format to be dissected.

Change-Id: I5a9f662b32ff7e042f753a92eaaa86c6e41f400a
Reviewed-on: https://code.wireshark.org/review/16
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-25 17:43:13 +00:00
Chris Maynard 4cabb63481 Fix Visual Studio Code Analysis warning C6001: Using uninitialized memory 'keylist'
svn path=/trunk/; revision=54050
2013-12-13 18:13:58 +00:00
Michael Mann 0c9aa51ec5 Patch to include YAML export. Bug 9452 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9452)
From Deon van der Westhuysen
From me: use switch statements instead of if-else

svn path=/trunk/; revision=53698
2013-12-01 15:44:22 +00:00
Michael Mann 60d6b05e23 Stats_tree enhancements for sorting, averages and burst rate. Bug 9452 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9452)
From Deon van der Westhuysen

- Bug fix: object leak in stats_tree after a tap reset (for example apply statistics preferences with a stats_tree window open)
- Bug fix: correct sample code in README.stats_tree
- Add: slash in plug-in name now creates submenu as docs describe (was a bug?)
- Add: menu separator before the stat_tree registered plug-ins
- Add: stats_tree can now calculate averages for nodes; automatically calculated for range nodes. Add section in README.stats_tree describing averages.
- Add: stats_tree can now calculate burst rate of each node (like rate but with a shorter, sliding time window)
- Add: sorting for stats_tree plug-ins. Can sort on node name, count, average, min, max values and burst rate.
- Add: preferences for stats_tree system (default sort column, burst calc params)
- Add: stats_tree window copy to clipboard and export and plain text, csv and XML.
- Added sample of new functionality in $srcdir/plugins/stats_tree/pinfo_stats_tree.c
- Moved all stats_tree sample plug-ins to "IP Statistics" submenu.

svn path=/trunk/; revision=53657
2013-11-29 22:47:59 +00:00
Guy Harris db25270df8 Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377
2013-11-17 02:55:14 +00:00
Guy Harris ad0a9f4b66 Indentation tweaks.
svn path=/trunk/; revision=53173
2013-11-08 19:38:28 +00:00
Martin Mathieson 6159e98cd3 Didn't need to include wtap.h again
svn path=/trunk/; revision=53171
2013-11-08 17:15:43 +00:00
Martin Mathieson 0c590a950a Fix up function names: type -> type_subtype
svn path=/trunk/; revision=53170
2013-11-08 17:12:31 +00:00
Guy Harris c4e9865f0c Fix more errors.
svn path=/trunk/; revision=53159
2013-11-08 01:25:48 +00:00
Guy Harris 7a2a486ef2 Wrong function.
svn path=/trunk/; revision=53158
2013-11-08 01:24:55 +00:00
Guy Harris 9dd06cd401 Fix errors.
svn path=/trunk/; revision=53157
2013-11-08 01:23:18 +00:00
Guy Harris bf4e84aba6 For open dialogs, offer a list of sets of extensions, not of file types;
.cap, for example, doesn't refer to a particular file type - a whole
bunch of file types use .cap.

Also offer, in addition to "All Files", "All Capture Files", which
matches all the extensions we know about.

svn path=/trunk/; revision=53156
2013-11-08 01:08:42 +00:00
Pascal Quantin cc0bba9e4b Tentative fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9287 :
Initialize ofn->lCustData variable

svn path=/trunk/; revision=52740
2013-10-21 18:03:37 +00:00
Pascal Quantin cf9bbdecef From RobiOneKenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9297 :
Add support for MSVC2013

svn path=/trunk/; revision=52716
2013-10-20 17:35:30 +00:00
Gerald Combs bc3cd5611e Make sure we have a valid capture file pointer in win32_export_file().
Fixes bug 9271.

svn path=/trunk/; revision=52612
2013-10-15 01:10:52 +00:00
Gerald Combs 259768dc1a Remove GTK+ and global cfile dependencies from file_dlg_win32.c.
Move the declaration of set_last_open_dir() to ui/util.h. It still
has separate GTK+ and Qt implemenations. We might want to move it to
ui/util.c at some point. Remove a lot of unnecessary GTK+ includes.
Remove most of the references to the global cfile while we're at it.

svn path=/trunk/; revision=52542
2013-10-11 17:20:50 +00:00
Guy Harris 32e1523bb2 For the Windows Open dialog for capture files, get rid of the "(*.*)" in
the "All Files" entry (the current UI guidelines from Microsoft say to
do so, and that's what Paint does, at least), and add an "All Capture
Files" entry with all the file extensions for the file types we support
(it'll pick up all text files, but there's not much we can do about
that, and it won't pick up files with *no* extension or weird
extensions, such as you might get from UN*X systems or from WinDump
commands, but at least it'll filter out some other crud).

Fix what appear to be memory leaks; that should be backported unless
I've missed something and they aren't leaks.

Fix an out-of-date comment, and add an additional comment.

svn path=/trunk/; revision=51481
2013-08-23 00:06:26 +00:00
Jeff Morriss 0a669967fa Move merge.{h,c} into wiretap: these modules use wiretap to merge files.
svn path=/trunk/; revision=50656
2013-07-16 02:35:33 +00:00
Guy Harris eedc0601d7 Fix whitespace.
svn path=/trunk/; revision=50572
2013-07-14 09:17:31 +00:00
Jeff Morriss 4dcc156cf3 Move the print modules into epan.
svn path=/trunk/; revision=50526
2013-07-12 03:50:50 +00:00
Chris Maynard 909d2eb309 Allow for column headers not to be printed in order to make it possible to export packets as plain text in a format that could then have a chance of being imported again (assuming other factors such as packet bytes were printed, etc.) in order to recover the original pcap file.
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1636

svn path=/trunk/; revision=50036
2013-06-19 15:22:56 +00:00
Gerald Combs 8b4b8154a4 The CommDlg_OpenSave_GetFilePath macro fetches the path+name of the most
recently selected file in the current file dialog. This isn't the proper
routine to use when trying to figure out the save/export file name. We
have to dig through the OPENFILENAME struct instead. Fixes bug 8224.

#Backport 1.10

svn path=/trunk/; revision=49765
2013-06-04 18:07:59 +00:00
Guy Harris b1ecd8d217 Add a wtap_dump_can_write() routine that indicates whether Wiretap
supports writing files with a given set of encapsulations and comment
types.  Use it, rather than asking for a list of file formats that
support the given set of encapsulation and comment types and checking
whether we got back such a list, or duplicating its logic.

Having file.c use it means that nobody's using
wtap_dump_can_write_encaps() any more; get rid of it.  Instead, have a
private routine that checks whether a given file format supports a given
set of encapsulations *and* comment types, and use that internally.

svn path=/trunk/; revision=48690
2013-04-01 21:17:50 +00:00
Guy Harris 82a602d697 Define a collection of bits for different types of capture file comments.
For each capture file type, have a bitset of comment types supported by
that capture file type.

Add a Wiretap routine that, for a given file type, returns the bitset of
comment types it supports.

Have wtap_get_savable_file_types() take a bitset of comment types that
need to be supported by the file types it returns.

Replace cf_has_comments() with a routine that returns a bitset of
capture file comment types in the capture file.

Use those routines in the capture file dialogs; don't wire in the notion
that pcap-NG supports all comment types and no other file formats
support any comment types.  (That's currently true, but we don't want to
wire that in as being forever true.)

svn path=/trunk/; revision=48689
2013-04-01 20:36:42 +00:00
Gerald Combs 9f1fd13e9a Use topic_action instead of topic_cb for the Windows file dialogs. Move
the common Qt help code to wireshark_application.cpp.

svn path=/trunk/; revision=45594
2012-10-16 19:47:43 +00:00
Gerald Combs 403e6dc86a Move common SSL key export routines to ui/ssl_key_export.[ch]. Make the
exported keys a gchar *. Implement SSL key exports in the Qt UI. Remove
some no-longer-necessary packet-ssl*.h includes.

Change lastOpenDir().absolutePath() to .canonicalPath(). Get rid of the
"Export As PostScript" action.

svn path=/trunk/; revision=45589
2012-10-16 18:14:16 +00:00
Gerald Combs 419f851e34 Fix Windows compilation problems from r45513. #ifdef out some non-Windows
code.  Get rid of a few uses of the global cfile.

svn path=/trunk/; revision=45514
2012-10-13 00:18:46 +00:00
Gerald Combs 18b10390da Move a couple of enums to the common UI directory. Remove an unused
definition.

svn path=/trunk/; revision=45440
2012-10-09 23:51:30 +00:00
Gerald Combs b28da10eec Fix Qt compilation on Windows. Check the user-supplied range syntax
and provide instant feedback in the Win32 file dialog similar to the Qt
code. Tango-ize some colors. Escape a backslash in QtShark.pro.

svn path=/trunk/; revision=45430
2012-10-09 15:34:40 +00:00
Gerald Combs 445148ac0e Add a PacketRangeGroupBox widget. Use it to implement "Export Selected
Packets". Not yet tested on Windows. "Ignore Packet" hasn't been
implemented so we can't test that either.

Create a SyntaxLineEdit widget from the QLineEdit code in
DisplayFilterEdit. Use it in the file import and export dialogs and the
PacketRangeGroupBox widget. This lets us provide instant feedback
instead of popping up an error dialog.

Expand the Tango color list based on
http://emilis.info/other/extended_tango .

Rearrange QtShark.pro to (hopefully) work better with Qt Creator.

svn path=/trunk/; revision=45405
2012-10-08 20:01:59 +00:00
Pascal Quantin e835a6f205 Fix crash when exporting packet dissection as plain text on Windows (regression introduced in r45333)
svn path=/trunk/; revision=45378
2012-10-08 09:22:46 +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
Gerald Combs bdd98d63cd Fix compilation on Windows. Add back and fix function definitions,
fix doxygen d ocumentation, other fixes.

svn path=/trunk/; revision=45298
2012-10-03 19:45:05 +00:00
Gerald Combs bcd2cea774 Unify the GTK+ and Win32 versions of "Export Specified Packets". Add a
shared "file_add_extension" routine. We no longer support _MSC_VER <
1400 so get rid of some clutter. Add a gzip checkbox to the Win32 export
packets dialog. Windows code hasn't yet been tested (and is likely
broken). I'll fix it shortly.

svn path=/trunk/; revision=45296
2012-10-03 19:24:14 +00:00
Gerald Combs f60693dbea Fix error checking logic.
svn path=/trunk/; revision=45144
2012-09-25 23:29:47 +00:00
Gerald Combs e9d4c115b5 Fix compilation on Windows.
svn path=/trunk/; revision=45106
2012-09-24 17:44:11 +00:00
Gerald Combs 25eab1c383 Unify some of the GTK+ and Win32 "Save As" code and behavior. This will
likely break compilation on Windows. I'll take care of it shortly.

svn path=/trunk/; revision=45105
2012-09-24 17:04:50 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Gerald Combs 3e05236eff Add gzip support to the Win32 "Save As" dialog. Don't crash in the Win32
merge dialog if we cancel. Adjust the size and location of the controls
in the Win32 open and merge file templates.

svn path=/trunk/; revision=45014
2012-09-19 23:06:39 +00:00
Gerald Combs f764eabb67 Combine some of the the Windows and non-Windows merge code and make it
behave the same on each platform. This might break the non-Windows builds.
I'll test & fix any problems shortly.

svn path=/trunk/; revision=44859
2012-09-10 21:27:49 +00:00
Gerald Combs 6f55c03852 Fix compilation warnings.
svn path=/trunk/; revision=44489
2012-08-14 16:01:47 +00:00
Gerald Combs 6791192b97 Don't overwrite preview item labels.
svn path=/trunk/; revision=44173
2012-07-31 22:12:41 +00:00
Gerald Combs 5fc656ee46 Add a preview to the common file dialog. Adjust the win32 file dialog
preview logic slightly.

svn path=/trunk/; revision=44080
2012-07-27 21:43:02 +00:00
Gerald Combs b0a562b82d Remove the filename from the Win32 file dialog preview. It's already
shown in two places and there's no reason to show it in a third.

Use CommDlg_OpenSave_GetFilePath instead of CommDlg_OpenSave_GetSpec so
that previews work properly for folders.

svn path=/trunk/; revision=43877
2012-07-21 01:14:08 +00:00
Gerald Combs 281e18d636 Move most of file_open_cmd to gtk_open_file. Make gtk_open_file
and win32_open_file behave similarly. _snwprintf is "banned". Use
StringCchPrintf instead. Tested on Windows. I'll test on OS X shortly.

svn path=/trunk/; revision=43756
2012-07-16 20:46:13 +00:00