aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
AgeCommit message (Collapse)AuthorFilesLines
2013-05-24Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8714 :Jeff Morriss1-1/+7
If we're not doing dissection (in 2-pass mode) then don't try to mark frames as depended upon: in that case epan has not been initialized so we shouldn't be looking in the edt (and anyway without dissection there won't be any dependent frames). (I'm not convinced there's any reason to run 2-pass mode without dissection, however...) svn path=/trunk/; revision=49554
2013-05-22No capture options if no libpcap.Guy Harris1-1/+1
svn path=/trunk/; revision=49519
2013-05-22AAAAAArgh. The capture_input_new_XXX routines are called fromGuy Harris1-3/+4
capture_sync.c, not from capture.c, so they should be declared in capture_sync.h, so callers that use the capture_sync.c stuff but not the capture.c stuff - such as TShark - get the declarations and get their implementations compared with the signatures that they should have. Doing so points out that some of them in TShark *don't*, so fix that. svn path=/trunk/; revision=49517
2013-05-22Another Win32-only fix.Guy Harris1-1/+1
svn path=/trunk/; revision=49501
2013-05-22Pull the capture-session state information out of capture_opts and putGuy Harris1-19/+23
it into a separate capture_session structure. capture_opts should contain only user-specified option information (and stuff directly derived from it, such as the "capturing from a pipe" flag). svn path=/trunk/; revision=49493
2013-05-22Rename capture_opts_trim_iface() toGuy Harris1-3/+3
capture_opts_default_iface_if_necessary(), to reflect what it actually does. svn path=/trunk/; revision=49491
2013-04-25Send the output of the -D and -L options to the standard output ratherGuy Harris1-21/+0
than the standard error. In Wireshark on Windows, create a console before doing so and destroy it before exiting. Don't do that in TShark or dumpcap, as those are console-mode programs on Windows. This should fix bug 8609 and still allow "wireshark -D" and "wireshark -L" to work when the standard output isn't redirected. svn path=/trunk/; revision=49025
2013-04-05Coalesce "-G fields2" and "-G fields3" into "-G fields", as discussed on -dev.Chris Maynard1-10/+3
See: http://www.wireshark.org/lists/wireshark-dev/201304/msg00015.html svn path=/trunk/; revision=48753
2013-03-30Update -2, -R and -Y to behave consistently as per the concensus reached onEvan Huus1-92/+38
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8223 Mention the new -Y flag and associated changes in the release notes. svn path=/trunk/; revision=48654
2013-03-27From Hadriel Kaplan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8223Evan Huus1-23/+126
Add a 2-pass display-filter flag to tshark so that reassembly and other forward- looking dissections can be used with filters. It's a bit of a hack, but this entire area of 2-pass analysis etc. is a giant pile of hacks to begin with and needs cleaning up. For now just having this feature is a big enough win. svn path=/trunk/; revision=48589
2013-03-20 From beroset:Bill Meier1-6/+6
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397 svn path=/trunk/; revision=48438
2013-03-15Fix the leaking of packet comments, i.e. the rest ofEvan Huus1-2/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7530 The frame_data_cleanup function was ambiguous; it was being used for two different purposes, and did neither of them quite properly. Split it instead into frame_data_reset and frame_data_destroy, and call the correct one depending on why we were originally calling frame_data_cleanup. svn path=/trunk/; revision=48324
2013-03-06Use explicit casts.Anders Broman1-4/+4
svn path=/trunk/; revision=48137
2013-03-05Followup to r48081: use the DEFAULT_CAPTURE_BUFFER_SIZE macro from r47942.Jeff Morriss1-1/+1
svn path=/trunk/; revision=48085
2013-03-05Default capture buffer size is now 2MB. (See also r47920 and r47937)Chris Maynard1-1/+1
svn path=/trunk/; revision=48081
2013-03-03Fix case where we were leaking frame_data if, during 2-pass analysis,Evan Huus1-0/+3
a frame did not pass the filter. svn path=/trunk/; revision=48031
2013-02-24Fix bug #8101: tshark -2 -r fragments.pcap -R snmp -w out.pcap segmentation ↵Jakub Zawadzki1-1/+1
fault When doing second pass tshark, packet data is read to cf->pd (and not already freed cf->wth buffer). Writting files with two pass analysis never worked, buggy since introducing two pass analysis in r30076. svn path=/trunk/; revision=47851
2013-02-24Fix bug #8160, one case left where delta of previously captured frame is ↵Jakub Zawadzki1-8/+11
incorrectly calculated: two passes wireshark && previously captured frame hasn't pass filter svn path=/trunk/; revision=47849
2013-02-20From Edwin Groothuis via ↵Chris Maynard1-0/+5
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8353 : Document http-related '-z' statistics; also add document -z help. From me: Don't print an error message for "-z help". (Only "http,stat," is suitable for backport to 1.8 and 1.6) svn path=/trunk/; revision=47763
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
2013-01-23Run epan_cleanup after printing the version information in tshark,Evan Huus1-0/+6
as it makes the results of ./tools/valgrind-wireshark.sh -n much more interesting and useful. svn path=/trunk/; revision=47221
2013-01-15Add some routines to wsutil to, at least on some platforms, addGuy Harris1-9/+19
information to crash dumps and the like. (Currently, we only handle OS X's CrashReporter, but we should do this on other platforms where this information can be added and would be helpful.) White space tweaks. svn path=/trunk/; revision=47104
2012-12-26Fix a bunch of warnings.Guy Harris1-1/+1
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-12-20Add -Q option to TShark to force only "true" errors to stderr. No "status" ↵Michael Mann1-4/+11
messages should be included if -Q option is specified. Bug 2881 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2881) svn path=/trunk/; revision=46627
2012-12-12Make the "-g" argument to tshark actually work (by passing it to dumpcap).Jeff Morriss1-2/+2
svn path=/trunk/; revision=46515
2012-12-12Document the "-g" option to dumpcap.Jeff Morriss1-0/+2
Add that option to tshark, too, and document it. The option can't be given to Wireshark because the GUI already has a "-g" (goto packet). svn path=/trunk/; revision=46513
2012-12-08Allow TShark to specify columns as fields with -e option ↵Michael Mann1-11/+15
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2892) svn path=/trunk/; revision=46465
2012-11-29Add an add_hosts_file routine that adds a "hosts" path to an array andGerald Combs1-12/+5
use it in tshark.c instead of read_hosts_file. This lets us use "-H" multiple times. Make read_hosts_file static. svn path=/trunk/; revision=46273
2012-11-27Delay the reading of the hosts file ("-H") until after cf_open() has beenJeff Morriss1-7/+18
called. (cf_open() calls init_dissection() which, since r45511, re-initializes the name resolution database.) Complain if the user gives an invalid argument to "-W". Specify the invalid argument if we don't like a "-z" argument. svn path=/trunk/; revision=46238
2012-11-25Fix a number of [-Wshadow] warnings;Bill Meier1-99/+115
Also: Do some minor whitespace changes svn path=/trunk/; revision=46182
2012-11-21On error, have capture_opts_trim_iface() return the exit status thatGuy Harris1-4/+4
should be used (on success, have it return 0). Exit with that exit status; if the problem is that we couldn't get the interface list or if there are no interfaces in that list, return 2, as that's not a command-line syntax error. svn path=/trunk/; revision=46108
2012-11-19From Mike Garratt:Anders Broman1-1/+2
Friendly Names for interfaces on Windows Notes on the changes the patch covers: * if_info_t struct: addition of friendly_name * Dumpcap Interface list format changes: + Win32: "dumpcap -D" shows friendly_name in place of descript if known + All: machine interface "dumpcap -D -Z none" includes friendly_name in the list in addition to the existing parameters * interface_options struct: addition of console_display_name + When an interface name is displayed in a console, it will typically be the console_display_name (instead of name). + console_display_name is used as the basis of the autogenerated temp filenames + console_display_name is typically set to the friendly_name if known, otherwise it is set to the interface name * Enhancements to capture_opts_add_iface_opt() (the function which process -i options). + Can now specify the interface using its name and friendly_name + Interface name matching is case insenstive + Name matching first attempts exact matching, then falls back to prefix matching (e.g. dumpcap -i local) + Validates interface names, instead of blindly sending them off to winpcap/libpcap + Interface specification by number is still supported. * capture_opts_trim_iface() has been refactored: + Instead of repeating a decent chunk of the cost in capture_opts_add_iface_opt(), it calls capture_opts_trim_iface() to specify the interface. * introduction of capture_win_ifnames.[ch] (windows only code) + Implements static function GetInterfaceFriendlyNameFromDeviceGuid() - a windows version independant function to convert an interface guid into its friendly name. Uses published api functions on windows vista and higher, but falls back to unpublished API functions on older windows releases. + void get_windows_interface_friendlyname(/* IN */ char *interface_devicename, /* OUT */char **interface_friendlyname); - extracts the GUID from the interface_devicename, then uses GetInterfaceFriendlyNameFromDeviceGuid() to do the resolution * Auto temp filename generation: + Now uses wireshark_pcapng_* or wireshark_pcap_* depending on file format + Basis temp filename format on console_display_name + Win32: if console_display_name is a windows interface guid, extracts numbers from GUID here (instead of in interface option processing) GUI CHANGES: * Dialog that displays when you click the "Manage Interfaces" button (within Capture Options dialog) has been renamed from "Add new interfaces" to "Interface Management" * ui/gtk/capture_dlg.c: new_interfaces_w variable renamed to interface_management_w * Win32: Local Interfaces tab on Interface Management dialog, shows includes friendly name as far left column * Interface Management dialog defaults to larger size on win32 - so it fits without resizing local interfaces tab * Interface Management dialog now saves preferences when you click the apply button (local hidden interfaces was not persisting across restarts) * Tweaks: "Interface Details" dialog (Interface list->Capture Interfaces -> Details): + "Friendly Name" renamed to "NDIS Friendly Name" + Added "OS Friendly Name" to the top of the list * Win32: The "Capture Interfaces" dialog now shows the friendly name instead of device guid * Welcome screen: + The height of the interface list scrollbox dynamically adjusts & updates to the number visible interfaces. Up to 10 interfaces can be listed without a scroll bar, the minimum height is for 2 interfaces. + Win32: now shows just the Friendly Name if known - in place of "Interfacename_Guid:(Description)" svn path=/trunk/; revision=46083
2012-10-27Don't use wtap_phdr() for getting pkthdr struct after wtap_seek_read().Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=45808
2012-10-23Inspired by ↵Chris Maynard1-9/+43
http://www.wireshark.org/lists/wireshark-users/201206/msg00025.html, add support for being able to specify a numeric range as the <selector> part of tshark's -d <layer type>==<selector>,<decode-as protocol> option. svn path=/trunk/; revision=45734
2012-10-221) Allow for the possibility for both packet summary and packet details to beChris Maynard1-66/+89
printed when either -T is not specified or "-T text" or "-T ps" is selected. 2) Allow for packet hex/ascii to be printed without necessarily requiring that either packet summary or packet details also be printed. This just means that if you want packet summary information, use "-Px" instead of just "-x". 3) Fix bug with order of evaluation of -V and "-T psml". 4) If a packet separator is specified, always use it regardless of the -PVx options chosen. 5) Don't print 2 lines of separation between packets when only printing hex/ascii. Print 1 line of separation as in all other cases. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7782 plus other misc. enhancements. svn path=/trunk/; revision=45715
2012-10-20Introduce epan_dissect_run_with_taps() which run dissection with taps.Jakub Zawadzki1-10/+2
unexport tap_queue_init, tap_push_tapped_queue svn path=/trunk/; revision=45670
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-20/+16
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-10-14Unused variableEvan Huus1-3/+3
svn path=/trunk/; revision=45544
2012-10-05Add a capture_file * element to packet_range_t and pass it explicitly inGerald Combs1-4/+4
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-02Get rid of the always-null and unused argument toGuy Harris1-3/+3
host_name_lookup_process(). If, in the future, we find that we need an argument for changes we're making, we can add it then. svn path=/trunk/; revision=45269
2012-10-02Fix a comment, add another comment, and fix indentation.Guy Harris1-6/+6
svn path=/trunk/; revision=45268
2012-09-23Store pointers to previously displayed and captured packet, not nstime_t deltas.Jakub Zawadzki1-8/+20
This commit reduces size (from 144B to 128B on AMD64) of frame_data structure. Part of bug 5821: Reduce per-packet memory requirements. svn path=/trunk/; revision=45071
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45015
2012-08-29Add casts to fix compilation with GCC.Evan Huus1-2/+2
Remove * from gconstpointers, they are already pointer types. Add modelines to packet.c and clean up indentation a bit. svn path=/trunk/; revision=44698
2012-08-29Fix Bug 7348 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7348)Michael Mann1-5/+26
svn path=/trunk/; revision=44696
2012-08-08Have (almost) all preferences use the generic preferences API (per ↵Michael Mann1-1/+1
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7402). This cleaned up a lot of hardcoded code and allows breaking up the prefs structure (or at least prevent it from growing too large) if desired. Bugfixed problems mentioned in http://www.wireshark.org/lists/wireshark-dev/201208/msg00001.html Column preferences now support default '#' character svn path=/trunk/; revision=44348
2012-08-08Add -A as command line option to wireshark and tshark.Irene Rüngeler1-2/+13
svn path=/trunk/; revision=44339
2012-07-22Only initialize fields in the print_args that are actually used.Evan Huus1-4/+6
This prevents a memory leak where we were allocating for print_args.range but never freeing. svn path=/trunk/; revision=43921
2012-07-06From Michael Mann:Anders Broman1-9/+10
Generic preferences implementation - Printing and Name Resolution. svn path=/trunk/; revision=43579
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536