aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
AgeCommit message (Collapse)AuthorFilesLines
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
2012-06-25From Michael Mann:Anders Broman1-4/+0
generic preferences implementation https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7402 svn path=/trunk/; revision=43484
2012-06-20If we're making two passes and we have a display filter applied, createGerald Combs1-1/+5
a protocol tree in process_packet_first_pass(). Otherwise we crash with ERROR:dfvm.c:434:dfvm_apply: assertion failed: (tree) svn path=/trunk/; revision=43420
2012-05-20Change the "user_saved" member of a capture_file structure toGuy Harris1-6/+8
"unsaved_changes", and have it be TRUE iff changes have been made to the file since it was read - *not* if it's a temporary file from a live capture. Check the "is_tempfile" member, and the "unsaved_changes" member, when appropriate. Just have a set_toolbar_for_capture_file() routine that updates the "save", "close", and "reload" toolbar as appropriate, given a capture_file structure - absorb the function of set_toolbar_for_unsaved_capture_file() into it. svn path=/trunk/; revision=42721
2012-05-16Fix a bunch of uninitialized variables found by Coverity Scan. CIDsGerald Combs1-0/+1
702403, 702404, 702405, 702406, 702407, 702408, 702409, 702410, 702411, and 702412. svn path=/trunk/; revision=42658
2012-04-16From Evan Huus:Anders Broman1-1/+0
Duplicate and misplaced 'break' statements. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7106 svn path=/trunk/; revision=42091
2012-03-14Don't free idb_inf in wtap_dump_open_ng(): free it in the callers. This ↵Jeff Morriss1-3/+3
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/+6
svn path=/trunk/; revision=41501
2012-02-21Use wtap_dump_open_ng() in tshark.Michael Tüxen1-11/+11
svn path=/trunk/; revision=41123
2012-02-21This should fix the buildbots...Michael Tüxen1-0/+8
The problem was that when reading a .pcap file, we don't have any IDBs. If reqested to write out an pcapng file, we (now) build a dummy IDB which uses the file's encapsulation as the interface encapsulation. Therefore it can't be per=packet. We need to fix this by using wtap_dump_open_ng()... svn path=/trunk/; revision=41122
2012-02-17Start moving files to ui/ and ui/cli/Jörg Mayer1-1/+1
svn path=/trunk/; revision=41047
2012-02-16With the WTAP_ERR_UNSUPPORTED error, Wiretap supplies a string givingGuy Harris1-0/+15
the details of what in particular is unsupported; report it in TShark and Wireshark. Handle WTAP_ERR_RANDOM_OPEN_PIPE in TShark. Handle WTAP_ERR_COMPRESSION_NOT_SUPPORTED in TShark, and have its error message in Wireshark not speak of gzip, in case we support compressed output in other formats in the future. If we see a second section header block in a pcap-NG file, don't report it as "the file is corrupted", report it as "the file uses a feature we don't support", as that's the case - and don't free up the interface data array, as the file remains open, and Wireshark might still try to access the packets we were able to read. svn path=/trunk/; revision=41041
2012-02-11It is a complete mistake to have *ANY* messages during packet captureGuy Harris1-10/+6
sent to the standard output if "-w" is specified because, when you capture, you can capture with the output directed to the standard output, and dumping some text crap to the standard output will corrupt your capture file. svn path=/trunk/; revision=40966
2012-02-05From Michael Mann:Anders Broman1-6/+10
Went through all stderr cases within tshark trying to make tshark "quieter". I basically ended up agreeing with the submitted in terms of what should be switched to stdout from stderr. The attached patch does that. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2881 svn path=/trunk/; revision=40862
2012-01-25Third try. This time pipes and stdin are supported and theMichael Tüxen1-0/+1
test scripts are passed. Use a global list containing all interfaces and only change properties of the entries when changes are made in the GUI. Do not misuse the list of interfaces specified on the command line anymore. This patch does not provide any new functionality, it just provides the base for future extensions like removing remote interface, mulitple airpcap devices and multiple pipes. This patch was provided by Irene Ruengeler. svn path=/trunk/; revision=40715
2012-01-24We need a 3rd try. (After learning how to run the testuite on Windows locally).Michael Tüxen1-1/+0
svn path=/trunk/; revision=40695
2012-01-24Second try. This time pipes and stdin are supported.Michael Tüxen1-0/+1
Use a global list containing all interfaces and only change properties of the entries when changes are made in the GUI. Do not misuse the list of interfaces specified on the command line anymore. This patch does not provide any new functionality, it just provides the base for future extensions like removing remote interface, mulitple airpcap devices and multiple pipes. This patch was provided by Irene Ruengeler. svn path=/trunk/; revision=40693