aboutsummaryrefslogtreecommitdiffstats
path: root/capinfos.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow wtap_read() and wtap_seek_read() to return records other than packets.Guy Harris2014-05-241-19/+21
| | | | | | | | | | | | | | | | | | | | | | | Add a "record type" field to "struct wtap_pkthdr"; currently, it can be REC_TYPE_PACKET, for a record containing a packet, or REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific data. Modify code that reads packets to be able to handle non-packet records, even if that just means ignoring them. Rename some routines to indicate that they handle more than just packets. We don't yet have any libwiretap code that supplies records other than REC_TYPE_PACKET or that supporting writing records other than REC_TYPE_PACKET, or any code to support plugins for handling REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug 8590. Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813 Reviewed-on: https://code.wireshark.org/review/1773 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."Guy Harris2014-05-231-45/+42
| | | | | | | | | | This reverts commit c0c480d08c175eed4524ea9e73ec86298f468cf4. A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes. That is in-progress. Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6 Reviewed-on: https://code.wireshark.org/review/1741 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Allow wtap_read() and wtap_seek_read() to return non-packet records.Guy Harris2014-05-231-42/+45
| | | | | | | | | | | This is the first step towards implementing the mechanisms requestd in bug 8590; currently, we don't return any records other than packet records from libwiretap, and just ignore non-packet records in the rest of Wireshark, but this at least gets the ball rolling. Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574 Reviewed-on: https://code.wireshark.org/review/1736 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Revert "Refactor Wiretap"Guy Harris2014-05-091-9/+9
| | | | | | | | | | This reverts commit 1abeb277f5e6bd27fbaebfecc8184e37ba9d008a. 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>
* Refactor WiretapMichael Mann2014-05-091-9/+9
| | | | | | | | | | | 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>
* Remove all $Id$ from top of fileAlexis La Goutte2014-03-041-2/+0
| | | | | | | | | | (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>
* Wireshark: Add option to choose format type of capture fileMichal Labedzki2014-02-251-1/+2
| | | | | | | | | | | | | | | | 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>
* Replace "svn" with "git" all over the place.Gerald Combs2014-02-071-3/+3
| | | | | | | | | | | | Rename "SVNPATH" to "GITBRANCH" since that seems more appropriate. Rename "svnversion.h" to "version.h" as Evan suggested. Update some URLs. In make-version.pl, make sure we don't set an improper upstream branch name. Use the number of commits + short hash from `git describe` for package names by default. Change-Id: I922bba8d83eabdf49284a119f55b4076bc469b96 Reviewed-on: https://code.wireshark.org/review/139 Reviewed-by: Gerald Combs <gerald@wireshark.org>
* Drop support of Visual Studio 2005Alexis La Goutte2014-01-261-9/+1
| | | | | | | | | * Remove _MSC_VER < 1500 check * Cleanup config.nmake See http://www.wireshark.org/lists/wireshark-dev/201305/msg00159.html svn path=/trunk/; revision=54965
* For getopt() arg processing:Bill Meier2014-01-021-95/+100
| | | | | | | | | | | | - Use exit(0) for -h option as per convention; For g_option...() arg processing (when USE_GOPTION is set): - Fix bug: 'capinfos x' doesn't print any info about x; (bug introduced in SVN #48481); - Use stderr for error messages related to cmd-line arg parsing; svn path=/trunk/; revision=54555
* Move most of the plugin code from epan to wsutil and remove allGuy Harris2013-12-021-14/+13
| | | | | | | | | | | | knowledge of particular types of plugins. Instead, let particular types of plugins register with the common plugin code, giving a name and a routine to recognize that type of plugin. In particular applications, only process the relevant plugin types. Add a Makefile.common to the codecs directory. svn path=/trunk/; revision=53710
* Move the epan/filesystem.c routines to wsutil; they're not specific toGuy Harris2013-11-171-2/+2
| | | | | | | packet dissection, they're specific to the entire Wireshark suite of programs. svn path=/trunk/; revision=53377
* nstime_to_sec() and capinfos secs_nsecs() seems to be same.Jakub Zawadzki2013-11-091-7/+1
| | | | svn path=/trunk/; revision=53185
* Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.Jakub Zawadzki2013-11-091-1/+1
| | | | | | After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy. svn path=/trunk/; revision=53184
* The "file types" we have are actually combinations of types andGuy Harris2013-11-081-3/+3
| | | | | | | | | | subtypes, e.g. Network Monitor version 1 and Network Monitor version 2 are separate "file types", even though they both come from Network Monitor. Rename various functions, #defines, and variables appropriately. svn path=/trunk/; revision=53166
* Print informations even on short reads. Bug 9310 ↵Michael Mann2013-10-221-4/+13
| | | | | | | | | | | | | (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9310) Before this patch, an error message would be printed when the file appears to be truncated. After this patch, a warning will be printed, but the information is still displayed. In both cases, capinfos exits with status code 1. From Peter Wu svn path=/trunk/; revision=52762
* Trivial: Fix typo.Chris Maynard2013-07-291-1/+1
| | | | svn path=/trunk/; revision=51011
* Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific ↵Jeff Morriss2013-07-151-2/+1
| | | | | | there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark). svn path=/trunk/; revision=50598
* disable printing of all infos when USE_GOPTION is set andMartin Kaiser2013-04-131-1/+5
| | | | | | | | a command line option for a specific info was set (in other words: make the behaviour of goption and getopt the same) svn path=/trunk/; revision=48841
* TABs -> spacesMartin Kaiser2013-04-131-201/+214
| | | | | | | add editor modelines reformat some parts svn path=/trunk/; revision=48840
* add a cast to make capinfos compile when USE_GOPTION is definedMartin Kaiser2013-04-131-1/+1
| | | | svn path=/trunk/; revision=48839
* capinfos -k displays the capture comment (from the shb)Martin Kaiser2013-04-131-1/+46
| | | | svn path=/trunk/; revision=48837
* From Balint:Gerald Combs2013-03-071-0/+13
| | | | | | | | | | | | | | | | | | | | [PATCH 1/2] Revert "Try to fix the "LNK4217: locally defined symbol" warnings. This reverts commit r48158. [PATCH 2/2] Employ small hack in editcap to link with a few objects from libwireshark properly From me: Add the ability to reset symbol exports via ws_symbol_export.h's include guard and do so in capinfos.c and editcap.c. We include ws_symbol_export.h in over 200 files so it didn't seem to make sense to remove its include guard entirely. svn path=/trunk/; revision=48170
* Use explicit casts.Anders Broman2013-03-051-1/+1
| | | | svn path=/trunk/; revision=48108
* str_util.c: Although the glib documentation doesn't explicitly say so,Gerald Combs2013-02-281-0/+5
| | | | | | | | | it looks like the thousands grouping (') modifier is supported so use it in format_size. capinfos.c: Set our locale. svn path=/trunk/; revision=47934
* Try to fix compilation on Windows.Gerald Combs2013-02-261-3/+3
| | | | svn path=/trunk/; revision=47901
* Print human-readable statistics by default. Raw values can be printedGerald Combs2013-02-261-11/+72
| | | | | | using "-M". Based on a suggestion by Hansang Bae. svn path=/trunk/; revision=47900
* include the wsutil/wsgcrypt.h instead of including gcrypt.h directlyMartin Kaiser2013-02-211-1/+1
| | | | svn path=/trunk/; revision=47802
* When any of our executables start on Windows create or open a "WiresharkGerald Combs2013-02-201-3/+4
| | | | | | | | is running" mutex. Have the NSIS installer check for this mutex and ask the user to close Wireshark if it's found. While not perfect this makes the WinSparkle update process much less annoying. svn path=/trunk/; revision=47758
* Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8105 :Pascal Quantin2013-01-041-1/+1
| | | | | | Allow use of huges values for localtime / ctime / gmtime with MSVC 2008 or later svn path=/trunk/; revision=46930
* We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss2012-09-201-2/+0
| | | | svn path=/trunk/; revision=45015
* Remove #define USE_GOPTION = 1, the code is incompleteAnders Broman2012-07-231-1/+0
| | | | svn path=/trunk/; revision=43945
* From Michael Mann:Anders Broman2012-07-061-0/+142
| | | | | | Generic preferences implementation - Printing and Name Resolution. svn path=/trunk/; revision=43579
* Update Free Software Foundation address.Jakub Zawadzki2012-06-281-1/+1
| | | | | | (COPYING will be updated in next commit) svn path=/trunk/; revision=43536
* Keep track, in Wiretap, of whether the file is compressed, and provideGuy Harris2012-05-241-1/+5
| | | | | | | | | | | 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
* Don't show time stamp-based information if we don't have it (now that weGuy Harris2012-02-261-36/+105
| | | | | | | | | | know whether packets - or "packets" - have time stamps). Show the time stamp order as "Unknown" if we don't have enough information to determine whether it's certainly in order or out of order (XXX - we should do that if we have only one packet that has a time stamp). svn path=/trunk/; revision=41186
* Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports anyGuy Harris2011-12-131-2/+2
| | | | | | | | | | | | | | form of corruption/bogosity in a file, including in a file header as well as in records in the file. Change the error message wtap_strerror() returns for it to reflect that. Use it for some file header problems for which it wasn't already being used - WTAP_ERR_UNSUPPORTED shouldn't be used for that, it should only be used for files that we have no reason to believe are invalid but that have a version number we don't know about or some other non-link-layer-encapsulation-type value we don't know about. svn path=/trunk/; revision=40175
* Handle ctime() and localtime() returning NULL and localtime() on WindowsGuy Harris2011-11-161-31/+30
| | | | | | blowing up when handed a bad value. svn path=/trunk/; revision=39878
* Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5608 :Jeff Morriss2011-08-091-3/+1
| | | | | | | | | | | | | | getopt() can/should normally be found in unistd.h, so: - When testing for getopt(), define that we HAVE_GETOPT instead of HAVE_GETOPT_H (to avoid confusion). - Don't attempt to include getopt.h: not all OS's have it (for example, Solaris 9 does not). - (All the places which need getopt already include unistd.h (if we have it).) If this breaks things on some OS, we might need (a real) HAVE_GETOPT_H check. svn path=/trunk/; revision=38437
* From Jose Pedro Oliveira via bug 5803:Stig Bjørlykke2011-06-281-1/+1
| | | | | | | #ifdef HAVE_LIBGCRYPT block includes a line too many. "Fixes 2nd instance of the problem" svn path=/trunk/; revision=37816
* Replace all strerror() with g_strerror().Stig Bjørlykke2011-06-281-1/+1
| | | | | | | | | Remove our local strerror implementation. Mark strerror as locale unsafe API. This fixes bug 5715. svn path=/trunk/; revision=37812
* Move the Windows argument list conversion code to a common routine.Gerald Combs2011-05-241-14/+2
| | | | svn path=/trunk/; revision=37372
* Use a comparison instead of an assignment. Fixes Coverity CID 1194.Gerald Combs2011-05-111-1/+1
| | | | svn path=/trunk/; revision=37066
* For "per packet" file encapsulation, display a list of the encapsulations ↵Bill Meier2011-05-021-1/+30
| | | | | | | | | | | | | | | seen ("long form" report). Example: File type: Microsoft NetMon 2.x File encapsulation: Per packet IEEE 802.11 plus Network Monitor radio header ToDo: For the tabular form report display the list of per-packet encapsulations seen. svn path=/trunk/; revision=36962
* Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discoveredGuy Harris2011-04-211-0/+1
| | | | | | | | | | | | | | by the gunzipping code. Have it also supply a err_info string, and report it. Have file_error() supply an err_info string. Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to suggest a decompression error - into the rawshark and tshark errors, along the lines of what other programs print. Fix a case in the Netscaler code where we weren't fetching the error code on a read failure. svn path=/trunk/; revision=36748
* Use g_snprintf instead of sprintf: Coverity 622.Chris Maynard2011-04-121-4/+4
| | | | | | Use g_strlcpy instead of strcpy: Coverity 632. svn path=/trunk/; revision=36595
* IMHO capinfos, when finished processing, should exit with an error statusBill Meier2011-04-061-9/+22
| | | | | | | | | | | | | | if an error occurred while processing. E.G.,: For the default (no -C option): 'capinfos invalid.xxx' or 'capinfos a.pcap invalid.xxx c.pcap' should exit with an error status (after processing all the input args) if there is an error for invalid.xxx. With this fix, I expect fuzz-test.sh (and list_protos_in_cap.sh and presumably other scripts) will work a bit more as as expected. svn path=/trunk/; revision=36487
* From Jose Pedro Oliveira:Anders Broman2011-04-051-1/+1
| | | | | | | #ifdef HAVE_LIBGCRYPT block includes a line too many. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5803 svn path=/trunk/; revision=36470
* Fix Windows comiler warning: remove unused 'wsadata' variable.Bill Meier2011-01-161-1/+0
| | | | svn path=/trunk/; revision=35560
* On Windows, convert all of our command-line arguments from UTF-16 toGerald Combs2011-01-061-0/+21
| | | | | | | UTF-8 where we don't already do so. In Wireshark use g_utf16_to_utf8 instead of utf_16to8. This should fix bug 5520. svn path=/trunk/; revision=35411