aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
Commit message (Collapse)AuthorAgeFilesLines
* From beroset:Bill Meier2013-03-201-1/+1
| | | | | | | remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397 svn path=/trunk/; revision=48438
* From Balint:Gerald Combs2013-03-071-3/+12
| | | | | | | | | | | | | | | | | | | | [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-2/+2
| | | | svn path=/trunk/; revision=48108
* When any of our executables start on Windows create or open a "WiresharkGerald Combs2013-02-201-0/+2
| | | | | | | | 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
* Previous commit put a little too much of the README.developer boilerplate in...Jeff Morriss2013-01-141-6/+0
| | | | svn path=/trunk/; revision=47065
* In response to http://ask.wireshark.org/questions/17660/licence-of-editcapJeff Morriss2013-01-141-2/+28
| | | | | | | and as per email response from Richard Sharpe, add GPLv2+ boilerplate header and license. svn path=/trunk/; revision=47063
* 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
* Fix a bunch of warnings.Guy Harris2012-12-261-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
* Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki2012-10-161-1/+1
| | | | | | Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
* From Jim Young:Anders Broman2012-10-151-1/+3
| | | | | | | | Have editcap use modulo when calculating filenum component of fileset name . https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7863 svn path=/trunk/; revision=45556
* From Bill Parker:Anders Broman2012-10-091-1/+1
| | | | | | | | Explicitly declare/cast 'unsigned <variable>' as 'unsigned int <variable>' https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7810 svn path=/trunk/; revision=45418
* 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
* Make count variable in editcap unsigned, fixes more format stringEvan Huus2012-09-091-1/+1
| | | | | | mismatches. svn path=/trunk/; revision=44820
* Fix a copy+paste error ('capinfos' appearing in error string).Martin Mathieson2012-07-161-1/+1
| | | | svn path=/trunk/; revision=43738
* Try to fix pcap-ng - most files created by editcap -c have no IDBAnders Broman2012-06-151-9/+10
| | | | | | | | https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7350 By using wtap_dump_open_ng() in all places. svn path=/trunk/; revision=43271
* Don't free idb_inf in wtap_dump_open_ng(): free it in the callers. This ↵Jeff Morriss2012-03-141-1/+4
| | | | | | fixes the double-free editcap crashes that the buildbot's been seeing lately. svn path=/trunk/; revision=41542
* From Jose Pedro Oliveira:Anders Broman2012-03-131-1/+3
| | | | | | | | the shb_userappl value wasn't being changed. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6937 svn path=/trunk/; revision=41530
* A modified version of "pcapng: shd_userappl in newly created files"Anders Broman2012-03-131-0/+5
| | | | | | | | | to only add the name if no name if there yet. Original patch from Jose Pedro Oliveira. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6937 svn path=/trunk/; revision=41524
* Free idb_inf and shb_hdr when done.Anders Broman2012-03-121-0/+2
| | | | svn path=/trunk/; revision=41501
* Use wtap_dump_open_ng(), so we preserve all the interfaces in pcap-NGGuy Harris2012-03-031-2/+7
| | | | | | files. svn path=/trunk/; revision=41328
* Revert SVN #40866 (which used g_fprintf() in place of fprintf()).Bill Meier2012-02-241-140/+141
| | | | | | | | | | | | | | Using g_fprintf() fails (crashes) on Windows because the Windows GLib DLL is linked with (depends upon) MSVCRT while editcap is linked with (depends upon) MSVCR90. IOW: "You can't do that ... (on Windows)" See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6695 (Comment 2) for some additional information. svn path=/trunk/; revision=41168
* From Alexander Koeppe:Anders Broman2012-02-051-141/+140
| | | | | | | | Eliminate Mixture of libc and glibc in editcap.c https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6695 svn path=/trunk/; revision=40866
* From Michael Mann:Anders Broman2012-01-231-1/+1
| | | | | | | | help page update (pcapng is now the default file format). https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6551 svn path=/trunk/; revision=40658
* Rename crypt-xxx to xxxJörg Mayer2012-01-151-1/+1
| | | | svn path=/trunk/; revision=40511
* 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
* When reporting "sorry, *this* packet can't be written to a file of thatGuy Harris2011-11-191-2/+19
| | | | | | | | | | | | | | | | | | | | | | | type" when writing out a capture file (i.e., writing a per-packet-encapsulation capture to a file type that supports it but doesn't support one of the packet's encapsulations), report the packet number and, when doing this in a merge operation, report the file from which it came. When reporting "sorry, that file can't be written to a file of that type, period", show the file type rather than the input file link-layer type that causes the problem. (We could show both. We could be *really* ambitious and iterate through all possible file types and show the ones that will or at least might work....) file_write_error_message() is documented as handling only UNIX-style errnos, and libwireshark should be usable without libwiretap, so leave it up to its callers to handle Wiretap errors such as WTAP_ERR_SHORT_WRITE. Clean up indentation. svn path=/trunk/; revision=39949
* 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
* Remove the snaplen check added in r37633: the change in r37634 makes itJeff Morriss2011-07-211-6/+0
| | | | | | unnecessary. svn path=/trunk/; revision=38155
* Don't sanity-check snaplen against frame length if snaplen is 0.Martin Mathieson2011-07-201-1/+1
| | | | svn path=/trunk/; revision=38132
* Prohibited APIs: strncpy -> g_strlcpy.Stig Bjørlykke2011-06-231-1/+1
| | | | svn path=/trunk/; revision=37768
* Have mergecap, tshark, and editcap write pcap-ng files by default. ThisGerald Combs2011-06-201-1/+5
| | | | | | | | is mainly an attempt to fix the currently-broken "test.sh" step on the XP buildbot. If this causes too many problems we might want to have suite-capture.sh:capture_step_snapshot pass "-P" to dumpcap instead. svn path=/trunk/; revision=37736
* See if this squelches some compiler warnings.Guy Harris2011-06-151-2/+2
| | | | svn path=/trunk/; revision=37669
* Simplify timestamp checking: only check the packet's timestamp ifJeff Morriss2011-06-091-4/+10
| | | | | | | | | | | | | | | | | check_startstop is set. Refuse to write packets that do not fit in the file type we're writing. This allows fuzz testing to be done on JPEGs without generating bogus files (with packets bigger than the maximum packet size). This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6010 . Note that this is only a problem with editcap is run with -T to force the encapsulation type. Maybe this needs a more generic solution (e.g., should this check be done in the wiretap routines?), but at least for now it'll pacify the buildbot. svn path=/trunk/; revision=37633
* Handle snaplen before choplen for consistency. Also, if chopping more bytesChris Maynard2011-05-311-10/+13
| | | | | | | than present, just chop all by setting caplen to 0. In all cases, don't touch len. In other words, change incl_len but leave orig_len alone. svn path=/trunk/; revision=37488
* When a snaplen is specified using "-s <snaplen", if it's smaller than theChris Maynard2011-05-311-21/+24
| | | | | | | original capture file's snaplen, save the new snaplen in the capture file header so wireshark and capinfos can report it. svn path=/trunk/; revision=37480
* Move the Windows argument list conversion code to a common routine.Gerald Combs2011-05-241-17/+5
| | | | svn path=/trunk/; revision=37372
* Don't bother to strcpy() an empty string; just set buf[0] = '\0': Coverity 626Chris Maynard2011-04-121-1/+1
| | | | svn path=/trunk/; revision=36601
* From Jason Masker (bug 5240):Sake Blok2011-02-041-10/+16
| | | | | | | | ` Allow editcap to chop from beginning of packet for decapsulation svn path=/trunk/; revision=35832
* On Windows, convert all of our command-line arguments from UTF-16 toGerald Combs2011-01-061-0/+18
| | | | | | | 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
* Fix various typos and spelling errors.Bill Meier2010-12-061-1/+1
| | | | svn path=/trunk/; revision=35126
* Attempt to fix warnings not previously seen with VS2008EE.Chris Maynard2010-11-241-5/+8
| | | | svn path=/trunk/; revision=35024
* When listing encapsulation types with -T or file types with -F, sort them.Chris Maynard2010-11-241-8/+39
| | | | svn path=/trunk/; revision=35022
* Make editcap -B work like expected: output no packets after the stop time.Sake Blok2010-11-161-4/+4
| | | | | | | Old behavior was to include a packet with a timestamp of 12:00:00.934 if -B "YYYY-MM-DD 12:00:00" was used. svn path=/trunk/; revision=34913
* From Jose Pedro Oliveira via ↵Jeff Morriss2010-11-011-10/+10
| | | | | | | | | | | | | | | | https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5353 : editcap -h sends 9 lines to stderr and the rest to stdout. This problem affects editcap 1.4.x (branch 1.4) and devel (trunk). How to duplicate: 1) run "editcap -h" 2) run "editcap -h > /dev/null" The attached patch replaces 9 ocurrences of "stderr" by "output" in the usage function. svn path=/trunk/; revision=34742
* Turn on ASLR via /DYNAMICBASE and DEP via SetProcessDEPPolicy().Gerald Combs2010-09-161-7/+7
| | | | svn path=/trunk/; revision=34137
* Fix a gcc -Wshadow warningBill Meier2010-06-031-13/+13
| | | | svn path=/trunk/; revision=33077
* From Jim Young via bug 4331:Gerald Combs2010-06-021-2/+154
| | | | | | | | | | | | | | This patch adds a new '-S' option to editcap that will rewrite timestamps of packets to insure that the new capture file is in strict chronological order. This option's primary use case is to fixup the occasional timestamps that have a negative delta time relative to previous packet. This feature is related to (but does not depend on) capinfos enhancement submitted in bug #4315 which helps identify tracefiles with "out-of-order" packets. svn path=/trunk/; revision=33042
* Move some code (including the optional objects) into libwsutilJeff Morriss2010-05-281-7/+7
| | | | svn path=/trunk/; revision=33012
* Fix various gcc -Wshadow warnings.Bill Meier2010-01-291-28/+28
| | | | svn path=/trunk/; revision=31729
* Make edticap behave like the rest of the Wireshark programs where it willStephen Fisher2009-12-291-64/+71
| | | | | | | | send normal -h output to stdout so it can be paginated and the usage output to stderr when there was an error in the command arguments. svn path=/trunk/; revision=31388