aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
AgeCommit message (Collapse)AuthorFilesLines
2013-02-26it's ==> itsBill Meier1-1/+1
svn path=/trunk/; revision=47894
2013-02-20When any of our executables start on Windows create or open a "WiresharkGerald Combs1-2/+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-22svn path=/trunk/; revision=47210Anders Broman1-22/+22
2013-01-15Add some routines to wsutil to, at least on some platforms, addGuy Harris1-10/+21
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
2013-01-02Allow pcap/pcapng format to be written to more than just a file (FILE*). ↵Michael Mann1-9/+9
Gives more flexibility if needed. WRITE_DATA macro replaced and applied consistently throughout pcapio.c svn path=/trunk/; revision=46891
2012-12-26Make dumpcap build on WindowsAnders Broman1-4/+7
svn path=/trunk/; revision=46788
2012-12-26Fix a bunch of warnings.Guy Harris1-15/+21
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-23More whitespace cleanups.Guy Harris1-82/+77
svn path=/trunk/; revision=46716
2012-12-23Add support for writing per packet comments when using pcapng.Michael Tüxen1-0/+1
Not actually used with this commit, which just brings in the infrastructure. svn path=/trunk/; revision=46715
2012-12-23Fix indentation.Guy Harris1-58/+54
svn path=/trunk/; revision=46712
2012-12-20fclose() and fflush() are standard C routines, so there's no need forGuy Harris1-6/+6
our own wrappers. (pcapio.c isn't using wrappers around, for example, fwrite().) svn path=/trunk/; revision=46640
2012-12-20Don't use an pcap structures in pcapio.[ch]. Michael Tüxen1-2/+12
Currently, pcapio is only used by dumpcap, which is only compiled if there is pcap support. However, making pcapio independent from libpcap allows it also to be used from text2pcap, which does not rely on libpcap. svn path=/trunk/; revision=46637
2012-12-20Add ws_fclose(), ws_fflush(), and ws_fdopen() to the fileutils.Michael Tüxen1-7/+17
Retire libpcap_fdopen(), libpcap_dump_flush(), and libpcap_dump_close(). svn path=/trunk/; revision=46636
2012-12-19Add support for writing the flags option in the enhancedMichael Tüxen1-1/+1
packet block (pcapng). svn path=/trunk/; revision=46619
2012-12-18- Make dumpcap build with the new bundle.Anders Broman1-0/+4
- Use the correct bundle id for GTK3 svn path=/trunk/; revision=46586
2012-12-12Make the "-g" argument to tshark actually work (by passing it to dumpcap).Jeff Morriss1-1/+1
svn path=/trunk/; revision=46515
2012-12-12Document the "-g" option to dumpcap.Jeff Morriss1-1/+1
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-10Change variable "devname" to "devicename" in numerous places to avoidStephen Fisher1-8/+8
to avoid -Wshadow warnings about conflicting with BSD's devname() function. svn path=/trunk/; revision=46494
2012-11-25Fix a number of [-Wshadow] warnings;Bill Meier1-151/+153
Also: Do some minor whitespace changes svn path=/trunk/; revision=46182
2012-11-22On UN*X, if an interface has a description, use it as the "friendlyGuy Harris1-2/+3
name". If it doesn't have a description, on OS X, use the System Configuration framework to attempt to get a "friendly name" for interfaces. If a loopback device doesn't have a friendly name, give it "Loopback" as the friendly name. Move the "turn a CFString into a mallocated C string" routine into common code, as it's used in more than one place. svn path=/trunk/; revision=46131
2012-11-21On error, have capture_opts_trim_iface() return the exit status thatGuy Harris1-2/+3
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-21Make the "Invalid capture filter" message resemble that of other programs.Guy Harris1-1/+1
svn path=/trunk/; revision=46107
2012-11-19From Mike Garratt:Anders Broman1-14/+39
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-03(Trivial): update a comment.Bill Meier1-2/+2
svn path=/trunk/; revision=45287
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-09-09Convert inpkts_to_sync_pipe and report_packet_count() to use unsigned intsEvan Huus1-5/+5
consistently. Cleans up some cppcheck warnings about signed/unsigned mismatches in format strings. svn path=/trunk/; revision=44818
2012-07-25Update recv/drop counters also when no threads are used.Michael Tüxen1-1/+5
This should fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7523 svn path=/trunk/; revision=43981
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-27Don't supply a fallback error message for pcap_open() unless it actuallyGuy Harris1-6/+9
fails. This may clear up the problem most recently reported in bug 7021 after the crash was fixed, where the capture starts successfully but an error dialog pops up. svn path=/trunk/; revision=43501
2012-06-24Pontus Fuchs via bug 6973:Jörg Mayer1-1/+67
Add last piece of the wireless toolbar: Use dumpcap to actually set the channel. svn path=/trunk/; revision=43466
2012-06-21Remove some trailing whitespaceJörg Mayer1-4/+4
svn path=/trunk/; revision=43425
2012-06-18Fix compilation on FreeBSD.Michael Tüxen1-1/+8
svn path=/trunk/; revision=43343
2012-06-09Fix Coverity CID 708961: Resource leak, by closing the socket if the ↵Chris Maynard1-7/+25
connect() fails. While there, print a human-readable error message on Windows like we do for other platforms. Lastly, be sure to specify FORMAT_MESSAGE_IGNORE_INSERTS in the dwFlags arg to all FormatMessage() calls where FORMAT_MESSAGE_FROM_SYSTEM is also specified. (Ref: http://blogs.msdn.com/b/oldnewthing/archive/2007/11/28/6564257.aspx) svn path=/trunk/; revision=43171
2012-06-08Some minimal documentation of remote capture interface formats for both ↵Chris Maynard1-2/+5
rpcap and the new TCP feature from bug 2788. svn path=/trunk/; revision=43156
2012-06-08Add another cast to make Windows buildbots happy.Chris Maynard1-1/+1
svn path=/trunk/; revision=43155
2012-06-08Add a cast.Anders Broman1-1/+1
svn path=/trunk/; revision=43154
2012-06-08From Alexey Neyman Forward ported by Michael Mann:Anders Broman1-147/+273
Allow captures over TCP connections. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2788 svn path=/trunk/; revision=43153
2012-05-25In cap_pipe_open_live(), be sure to call ws_close(fd) before returning due ↵Chris Maynard1-0/+2
to a couple of error condtions. Fixes Coverity CID 702395 Resource leak. svn path=/trunk/; revision=42844
2012-05-18Expand a comment.Guy Harris1-2/+12
Clear the struct sigaction *before* we fill in any fields in it. svn path=/trunk/; revision=42706
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-05-07From Evan Huus:Bill Meier1-19/+22
In get_capture_device_open_failure_messages() in dumpcap.c, there are some statements that should have been guarded by ifdefs, causing a little unnecessary work on some platforms, and a bunch of unused-variable warnings from static analyzers. The patch fixes the problem. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7228 svn path=/trunk/; revision=42454
2012-04-25Set also the pcap buffer, if the default of 1 MB is used. This bug wasMichael Tüxen1-1/+1
reported by Guy. svn path=/trunk/; revision=42246
2012-04-25Report the packets captured and the packets dropped (either by libpcap or by ↵Michael Tüxen1-3/+3
dumpcap). svn path=/trunk/; revision=42245
2012-04-25Allow writing ISB with given recv/drop counters.Michael Tüxen1-1/+12
No functional change by this commit. svn path=/trunk/; revision=42242
2012-04-25Fix the packet counters.Michael Tüxen1-2/+3
This fixes the inconsistencies reported on the command line by dumpcap as indicated by https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7191 svn path=/trunk/; revision=42236
2012-04-25Fix locking problem.Michael Tüxen1-0/+1
svn path=/trunk/; revision=42235
2012-04-14From Evan Huus: add a missing free. Fixes bug 7092.Guy Harris1-0/+1
svn path=/trunk/; revision=42070
2012-04-04Fix tpo.Guy Harris1-1/+1
svn path=/trunk/; revision=41941
2012-04-04Work around that WinPcap bug for another pcap_open() call.Guy Harris1-0/+7
svn path=/trunk/; revision=41938
2012-04-04Work around WinPcap bug wherein pcap_open() returns -1 without puttingGuy Harris1-2/+17
an error message into errbuf (the bug has been reported to winpcap-bugs). Should fix bug 6922. svn path=/trunk/; revision=41937