aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
AgeCommit message (Collapse)AuthorFilesLines
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-25Wireshark: Add option to choose format type of capture fileMichal Labedzki1-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>
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-26Drop support of Visual Studio 2005Alexis La Goutte1-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
2014-01-23Given that we allow the 'outfile file' to be stdout, then presumably allBill Meier1-16/+16
text messages (including informational) should go to stderr. svn path=/trunk/; revision=54930
2014-01-23printf(...) --> fprintf(stderr,...) (in a commented out line of code)Bill Meier1-1/+1
svn path=/trunk/; revision=54929
2014-01-22Don't write out packets that have a "captured length" bigger than we'reGuy Harris1-3/+19
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-17From Toralf FörsterMartin Kaiser1-1/+1
fix format strings for signed integers https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9637 svn path=/trunk/; revision=54835
2014-01-03For '-h' option: exit(0) as per convention;Bill Meier1-76/+75
No need to build a constant string on the stack at runtime; Fix a typo; Do some whitespace changes; Change tab-width & etc to 8 in editor modelines. svn path=/trunk/; revision=54581
2013-12-23From Ville Skyttä: Spelling FixesBill Meier1-1/+1
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9591 svn path=/trunk/; revision=54387
2013-12-02Move most of the plugin code from epan to wsutil and remove allGuy Harris1-13/+11
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
2013-11-17Move the epan/filesystem.c routines to wsutil; they're not specific toGuy Harris1-1/+1
packet dissection, they're specific to the entire Wireshark suite of programs. svn path=/trunk/; revision=53377
2013-11-15Fix chopping when offset is 0. Fixes ↵Chris Maynard1-8/+8
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9422 svn path=/trunk/; revision=53345
2013-11-09Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.Jakub Zawadzki1-2/+2
After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy. svn path=/trunk/; revision=53184
2013-11-08The "file types" we have are actually combinations of types andGuy Harris1-14/+14
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-10-29From Peter WuMartin Kaiser1-9/+14
write editcap debug infos to stderr print some of those messages only in verbose mode https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9342 svn path=/trunk/; revision=52942
2013-09-16Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+1
svn path=/trunk/; revision=52097
2013-09-09Remove a leftover #if 0 block.Chris Maynard1-6/+1
svn path=/trunk/; revision=51888
2013-09-09Fix the "crossed chopping region" problem. Also, move chopping to its own ↵Chris Maynard1-82/+128
function for both clarity and correctness since we need to compute chop offsets and lengths on a per-packet basis whereas previously this was not being done. Lastly, try to improve the documentation a bit concerning chopping and provide another example depicting 2 separate chopping regions. *Maybe* this is clearer? One more example here for posterity: Given the following 75 byte packet, there are 8 different ways to chop the 2 regions marked as 10 and 20 in a single pass: <--------------------------- 75 ----------------------------> +---+-------+-----------+---------------+-------------------+ | 5 | 10 | 15 | 20 | 25 | +---+-------+-----------+---------------+-------------------+ 1) editcap -C 5:10 -C -25:-20 in.pcap out.pcap 2) editcap -C 5:10 -C 50:-20 in.pcap out.pcap 3) editcap -C -70:10 -C -25:-20 in.pcap out.pcap 4) editcap -C -70:10 -C 50:-20 in.pcap out.pcap 5) editcap -C 30:20 -C -60:-10 in.pcap out.pcap 6) editcap -C 30:20 -C 15:-10 in.pcap out.pcap 7) editcap -C -45:20 -C -60:-10 in.pcap out.pcap 8) editcap -C -45:20 -C 15:-10 in.pcap out.pcap svn path=/trunk/; revision=51886
2013-09-09The file was a weird mix of 2 and 4 indent so use a consistent 4-space ↵Chris Maynard1-1226/+1222
indent scheme and add modelines to match. Also, declare a few variables static. (A fix for crossed chopping regions should be coming in the near future ...) svn path=/trunk/; revision=51863
2013-09-09OK, allow either positive or negative offsets no matter if we're chopping ↵Chris Maynard1-30/+37
from the beginning or the end. Given the following example, it's now possible to chop the 10 bytes depicted from the 100 byte packet 4 different ways and achieve the exact same results: <-------- 100 --------> Methods: 1) editcap -C 20:10 in.pcap out.pcap +------+----+---------+ 2) editcap -C -80:10 in.pcap out.pcap | 20 | 10 | 70 | 3) editcap -C -70:-10 in.pcap out.pcap +------+----+---------+ 4) editcap -C 30:-10 in.pcap out.pcap svn path=/trunk/; revision=51854
2013-09-08Specify the optional offset as a positive value, regardless of chopping from ↵Chris Maynard1-6/+8
packet beginning or packet end. I *think* this will be easier syntax to remember. svn path=/trunk/; revision=51848
2013-09-08Allow an optional offset to be specified when chopping bytes from packets.Chris Maynard1-25/+83
svn path=/trunk/; revision=51845
2013-08-01Move a bunch of the crypt modules and pint.h into wsutil.Jeff Morriss1-1/+1
This means wsutil now links against libcrypt. Protect a bunch of the crypt header files from multiple inclusion. svn path=/trunk/; revision=51100
2013-07-16Move strnatcmp.{h,c} from epan into wsutil: there's nothing epan-specificJeff Morriss1-2/+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-15Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific ↵Jeff Morriss1-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
2013-07-12Allow -C <choplen> to be used more than once so it is now possible to chop ↵Chris Maynard1-26/+37
bytes from both the beginning and end of a packet in a single step. svn path=/trunk/; revision=50536
2013-07-10Add -L option to allow adjustment of original frame length. This change was ↵Chris Maynard1-75/+97
motivated by a question on ask where the user currently has to jump through hoops to accomplish the same thing which can now be done in 1 step via: editcap -T wpan -C 16 -L -F libpcap test.pcap test_wpan.pcap I thought it would be useful enough for others as well. Ref: http://ask.wireshark.org/questions/22689/problems-with-editcap-and-wpan-encapsulation-option svn path=/trunk/; revision=50491
2013-07-10Add strnatcmp by Martin Pool for 'natural order' string comparisons, and ↵Chris Maynard1-2/+10
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-06-25Move a couple of time-related modules into wsutil.Jeff Morriss1-1/+1
A bunch of files didn't really need to include these header files so remove the include line rather than changing it. svn path=/trunk/; revision=50154
2013-03-20 From beroset:Bill Meier1-1/+1
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397 svn path=/trunk/; revision=48438
2013-03-07From Balint:Gerald Combs1-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
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/+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
2013-01-14Previous commit put a little too much of the README.developer boilerplate in...Jeff Morriss1-6/+0
svn path=/trunk/; revision=47065
2013-01-14In response to http://ask.wireshark.org/questions/17660/licence-of-editcapJeff Morriss1-2/+28
and as per email response from Richard Sharpe, add GPLv2+ boilerplate header and license. svn path=/trunk/; revision=47063
2013-01-04Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8105 :Pascal Quantin1-1/+1
Allow use of huges values for localtime / ctime / gmtime with MSVC 2008 or later svn path=/trunk/; revision=46930
2012-12-26Fix a bunch of warnings.Guy Harris1-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
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-1/+1
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-10-15From Jim Young:Anders Broman1-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
2012-10-09From Bill Parker:Anders Broman1-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
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-09-09Make count variable in editcap unsigned, fixes more format stringEvan Huus1-1/+1
mismatches. svn path=/trunk/; revision=44820
2012-07-16Fix a copy+paste error ('capinfos' appearing in error string).Martin Mathieson1-1/+1
svn path=/trunk/; revision=43738
2012-06-15Try to fix pcap-ng - most files created by editcap -c have no IDBAnders Broman1-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
2012-03-14Don't free idb_inf in wtap_dump_open_ng(): free it in the callers. This ↵Jeff Morriss1-1/+4
fixes the double-free editcap crashes that the buildbot's been seeing lately. svn path=/trunk/; revision=41542
2012-03-13From Jose Pedro Oliveira:Anders Broman1-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
2012-03-13A modified version of "pcapng: shd_userappl in newly created files"Anders Broman1-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
2012-03-12Free idb_inf and shb_hdr when done.Anders Broman1-0/+2
svn path=/trunk/; revision=41501
2012-03-03Use wtap_dump_open_ng(), so we preserve all the interfaces in pcap-NGGuy Harris1-2/+7
files. svn path=/trunk/; revision=41328