aboutsummaryrefslogtreecommitdiffstats
path: root/mergecap.c
AgeCommit message (Collapse)AuthorFilesLines
2014-10-29Rename the strnatcmp.c routines and make them use the g_ascii_XXX() routines.Guy Harris1-2/+2
Rename strnatcmp()/strnatcasecmp() to ws_ascii_XXX(), and make them use the g_ascii_XXX() routines rather than ctype.h routines, to eliminate locale-dependent behavior. (If you want locale-dependent "natural order" sorting, you probably want "dictionary order" sorting, which is more complicated than just natural order sorting.) Change-Id: I837f2776b2a909b547dc9a6072e497911b5380e5 Reviewed-on: https://code.wireshark.org/review/4985 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-22Ensure pcapng application name is always dynamically allocatedEvan Huus1-1/+1
Change-Id: I408944dfb0fa35bae6019ed0d6d810525b2ffcae Reviewed-on: https://code.wireshark.org/review/4254 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-24Modify includes of config.h so that out-of-tree builds, i.e. CMakeGraham Bloice1-1/+1
don't pick up the in-tree copy. Change-Id: I7ec473876cdba1a025c52362d7f6adc62d24ce71 Reviewed-on: https://code.wireshark.org/review/3798 Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-08-05Fix whitespace/indentation to match editor modelines.Bill Meier1-1/+1
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca Reviewed-on: https://code.wireshark.org/review/3452 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-03Use get_*_int() from wsutil, rather than defining our own.Guy Harris1-39/+25
Change-Id: I4811d87a903cc3cea93e12883edf25bcd1271a53 Reviewed-on: https://code.wireshark.org/review/2795 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03Make --help and --version information a bit more uniform.Guy Harris1-23/+73
Have --version print the version number, the copyright information, the "compiled with" information, the "running on/with" information, and the compiler information. Have --help print the version number, a one-line summary of what the program does, a reference to http://www.wireshark.org for more information, a Usage: line, and a list of command-line options. This means programs doing that don't need to include version.h; that's left up to get_ws_vcs_version_info() to do. Change-Id: Idac641bc10e4dfd04c9914d379b3a3e0cc5ca8cb Reviewed-on: https://code.wireshark.org/review/2794 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03More getopt_long, to add --help and --version support.Guy Harris1-1/+10
Change-Id: I946067b972a70154f02ab561bc0fd029a7a5abc4 Reviewed-on: https://code.wireshark.org/review/2791 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21Add command-line argument to request the version to a number of the utilities.Jeff Morriss1-6/+17
In some cases "-v" was already used so "-V" is the option. Note that the version information in these utilities is much shorter than what is presented by the big programs. As requested by https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5804 Bug: 5804 Change-Id: I35db35a4eace2797afd895f9be7322ef39928480 Reviewed-on: https://code.wireshark.org/review/2489 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09Revert "Refactor Wiretap"Guy Harris1-8/+8
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>
2014-05-09Refactor WiretapMichael Mann1-8/+8
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-03-04Remove all $Id$ from top of fileAlexis La Goutte1-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>
2014-02-25Fix mergecap.c: Dereference of null pointer (clang analyzer)Hadriel Kaplan1-2/+2
Change-Id: I89076388db8522c5fbdf72505f50e1380f1ab391 Reviewed-on: https://code.wireshark.org/review/369 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-07Replace "svn" with "git" all over the place.Gerald Combs1-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>
2014-01-22Don't write out packets that have a "captured length" bigger than we'reGuy Harris1-4/+17
willing to read or that's bigger than will fit in the file format; instead, report an error. For the "I can't write a packet of that type in that file type" error, report the file type in question. svn path=/trunk/; revision=54882
2014-01-21Check the return of wtap_dump_close() even if we've gotten a read error;Guy Harris1-3/+10
the only reason not to check it is if we've already gotten a write error and another write error would be superfluous (either "you got two of the same error" or "you got an I/O error *and* you ran out of disk space/disk quota" is of limited interest). Discard the return value of wtap_dump_close() in the case where we've already gotten a write error, in the hopes of squelching a Coverity warning. svn path=/trunk/; revision=54872
2014-01-03For -h option: output to stdout and exit(0) as per convention;Bill Meier1-45/+54
Do some whitespace changes; Change editor-modelines tab-width & etc to 8. svn path=/trunk/; revision=54582
2013-11-08The "file types" we have are actually combinations of types andGuy Harris1-9/+9
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
2013-09-06Whitespace cleanup, sort options, add modelines.Chris Maynard1-75/+82
svn path=/trunk/; revision=51804
2013-07-16Move merge.{h,c} into wiretap: these modules use wiretap to merge files.Jeff Morriss1-8/+4
svn path=/trunk/; revision=50656
2013-07-16Move strnatcmp.{h,c} from epan into wsutil: there's nothing epan-specificJeff Morriss1-1/+2
there and moving it avoids having to recompile the file for use in editcap and mergecap (which don't link against libwireshark). svn path=/trunk/; revision=50650
2013-07-10Add strnatcmp by Martin Pool for 'natural order' string comparisons, and ↵Chris Maynard1-1/+14
make use of it in editcap and mergecap for listing encapsulation types. For example: Before: user0 - USER 0 user1 - USER 1 user10 - USER 10 user11 - USER 11 user12 - USER 12 user13 - USER 13 user14 - USER 14 user15 - USER 15 user2 - USER 2 user3 - USER 3 user4 - USER 4 user5 - USER 5 user6 - USER 6 user7 - USER 7 user8 - USER 8 user9 - USER 9 After: user0 - USER 0 user1 - USER 1 user2 - USER 2 user3 - USER 3 user4 - USER 4 user5 - USER 5 user6 - USER 6 user7 - USER 7 user8 - USER 8 user9 - USER 9 user10 - USER 10 user11 - USER 11 user12 - USER 12 user13 - USER 13 user14 - USER 14 user15 - USER 15 svn path=/trunk/; revision=50482
2013-03-10Only cast the variable after checking it.Michael Tüxen1-3/+3
svn path=/trunk/; revision=48222
2013-03-05Use explicit casts.Anders Broman1-2/+2
svn path=/trunk/; revision=48108
2013-02-20When any of our executables start on Windows create or open a "WiresharkGerald Combs1-0/+1
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
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-2/+1
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45015
2012-05-10Avoid needlessly shadowing another variable.Martin Mathieson1-1/+0
svn path=/trunk/; revision=42553
2012-04-25Fix typo.Michael Tüxen1-1/+1
svn path=/trunk/; revision=42239
2012-04-25Fix copy and paste error.Michael Tüxen1-1/+1
Reported by Evan Huus. This should fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7194 svn path=/trunk/; revision=42238
2012-04-25Fix compilation. While there, remove some trailing whitespaces.Michael Tüxen1-2/+2
svn path=/trunk/; revision=42237
2012-04-25use in_files->filenameAnders Broman1-1/+1
svn path=/trunk/; revision=42233
2012-04-25Add some info in SHB if writing a pcap-ng file.Anders Broman1-1/+24
svn path=/trunk/; revision=42232
2012-01-23From Michael Mann:Anders Broman1-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
2011-12-22Alphabetize the list of encapsulation types via "mergecap -T" as well as the ↵Chris Maynard1-14/+51
list of capture file types via "mergecap -F". svn path=/trunk/; revision=40282
2011-12-13Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports anyGuy Harris1-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
2011-11-30Hopefully clarify usage a bit to indicate multiple infile's can be specified ↵Chris Maynard1-2/+20
to be merged. Also, add GPL and copyright info. svn path=/trunk/; revision=40051
2011-11-30From Eugene Bogush: Initialize read_err to 0 so mergecap works again. Fixes ↵Chris Maynard1-1/+1
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6623 svn path=/trunk/; revision=40048
2011-11-21On an I/O error, merge_read_packet() and merge_append_read_packet() needGuy Harris1-2/+7
to return a pointer to the merge_in_file_t that got the error. Set *err to 0 on success and an error code on an err, treat a null return as an EOF indication, and if we don't get a null return check for a non-zero error code and treat that as an I/O error. svn path=/trunk/; revision=39964
2011-11-19When reporting "sorry, *this* packet can't be written to a file of thatGuy Harris1-12/+25
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
2011-08-09Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5608 :Jeff Morriss1-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
2011-06-28Replace all strerror() with g_strerror().Stig Bjørlykke1-1/+1
Remove our local strerror implementation. Mark strerror as locale unsafe API. This fixes bug 5715. svn path=/trunk/; revision=37812
2011-06-20Have mergecap, tshark, and editcap write pcap-ng files by default. ThisGerald Combs1-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
2011-05-24Move the Windows argument list conversion code to a common routine.Gerald Combs1-14/+2
svn path=/trunk/; revision=37372
2011-01-06On Windows, convert all of our command-line arguments from UTF-16 toGerald Combs1-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
2010-05-28Move some code (including the optional objects) into libwsutilJeff Morriss1-1/+1
svn path=/trunk/; revision=33012
2009-10-06Invert check for getopt: NEED_GETOPT_H -> HAVE_GETOPT_HStig Bjørlykke1-4/+4
Rename getopt.[ch] -> wsgetopt.[ch] to avoid name collision. svn path=/trunk/; revision=30370
2009-10-05Fixed a int/long warning.Stig Bjørlykke1-3/+3
svn path=/trunk/; revision=30330
2009-07-22Use "svn info" to fetch the version by default. Fetch the repository path asGerald Combs1-1/+1
well. Add the repository path to the version strings. svn path=/trunk/; revision=29171
2009-05-12Minor cleanup of "-h" output text.Bill Meier1-12/+12
svn path=/trunk/; revision=28334
2008-05-22Move the file utility functions from wiretap to libwsutil so thatJeff Morriss1-5/+5
libwireshark (and the plugins using those functions) do not depend on wiretap on Windows. While doing that, rename the eth_* functions to ws_*. svn path=/trunk/; revision=25354