aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.c
AgeCommit message (Collapse)AuthorFilesLines
2013-08-29Handle the 2GiB boundary case of the max filesize autostop condition ↵Chris Maynard1-2/+2
properly so that we avoid overflow conditions and so that we ensure we don't capture more than 2GiB. Also, document the max filesize autostop value of 2GIB as well as indicating that it's truly GiB and not GB. This fixes the problem reported on ask: http://ask.wireshark.org/questions/23891/wireshark-wont-run-with-multiple-capture-files #BACKPORT(1.10) ... not sure about 1.8? svn path=/trunk/; revision=51576
2013-07-27only one --capture-comment option may be given to dumpcapMartin Kaiser1-0/+4
svn path=/trunk/; revision=50946
2013-07-27command line option --capture-comment for dumpcapMartin Kaiser1-0/+3
svn path=/trunk/; revision=50945
2013-07-27add capture_comment to the capture_options structureMartin Kaiser1-0/+1
svn path=/trunk/; revision=50943
2013-06-27forgot from the las commit...Luis Ontanon1-2/+2
svn path=/trunk/; revision=50191
2013-06-04From Mike Garratt:Anders Broman1-0/+6
Friendly Names support causing unnecessary delay when Wireshark starts. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8034 svn path=/trunk/; revision=49752
2013-05-22Pull the capture-session state information out of capture_opts and putGuy Harris1-19/+1
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-2/+5
capture_opts_default_iface_if_necessary(), to reflect what it actually does. svn path=/trunk/; revision=49491
2013-05-13Don't fill in err_str if we're not going to use it.Guy Harris1-1/+1
(This helps flag capture_interface_list() calls that should perhaps be checked to see whether an error should be reported if they fail.) svn path=/trunk/; revision=49281
2013-05-13Eliminate some includes of ui/simple_dialog.h by files that don't useGuy Harris1-1/+0
anything from it. svn path=/trunk/; revision=49278
2013-04-25Send the output of the -D and -L options to the standard output ratherGuy Harris1-12/+11
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-03-13Add interface options preferences.Irene Rüngeler1-0/+1
svn path=/trunk/; revision=48275
2013-02-28Add a #define for the default capture buffer size and use it.Jeff Morriss1-1/+1
svn path=/trunk/; revision=47942
2013-02-27Increase the default buffer size to 2MB.Anders Broman1-1/+1
svn path=/trunk/; revision=47920
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-12Make the "-g" argument to tshark actually work (by passing it to dumpcap).Jeff Morriss1-7/+11
svn path=/trunk/; revision=46515
2012-11-22On UN*X, if an interface has a description, use it as the "friendlyGuy Harris1-5/+5
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-21In capture_opts_add_iface_opt(), only *require* us to get the interfaceGuy Harris1-75/+88
list if the user specified a number; otherwise, if we couldn't get the list, just use what the user specified, so they can specify interfaces in order to test them to see why they're not showing up in the list. svn path=/trunk/; revision=46112
2012-11-21If we don't find the specified interface name in the list, use itGuy Harris1-3/+11
anyway, so that, for example, if an interface doesn't show up in the list for some reason, the user can try specifying it explicitly for testing purposes. svn path=/trunk/; revision=46109
2012-11-21On error, have capture_opts_trim_iface() return the exit status thatGuy Harris1-15/+11
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-20We don't use get_windows_interface_friendlyname() in capture_opts.c, soGuy Harris1-32/+36
we don't need to include capture_win_ifnames.h. Clean up white space. svn path=/trunk/; revision=46095
2012-11-19Failure to find the interface should cause *shark to exit with a status of ↵Jeff Morriss1-1/+1
1, not 2. svn path=/trunk/; revision=46089
2012-11-19As suggested by Evan: just make the variable a size_t instead of casting ↵Jeff Morriss1-2/+2
away the warning. svn path=/trunk/; revision=46088
2012-11-19I'm pretty confident the string length will fit in 32 bits; cast away the ↵Jeff Morriss1-11/+11
"possible loss of data" warning on the Win64 build. svn path=/trunk/; revision=46087
2012-11-19From Mike Garratt:Anders Broman1-96/+124
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-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-15Fix for bug #7634. Print 'unspecified' in case a string is NULL.Irene Rüngeler1-12/+12
svn path=/trunk/; revision=44512
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-04-23Remove lines that are not needed.ruengeler1-13/+11
svn path=/trunk/; revision=42208
2012-04-23Fix bug #7178 reported by aparanruengeler1-2/+2
svn path=/trunk/; revision=42206
2012-03-13Closing a capture file has nothing to do with the list of interfaces onGuy Harris1-0/+19
which to do a live capture; don't clear the latter list when closing the capture file. collect_ifaces() should clear out the existing list of interfaces before filling that list up with the interfaces selected by the user. In addition, when it frees up interfaces in that list, it should free up the strings attached to those interfaces. svn path=/trunk/; revision=41517
2012-03-12capture_opts_add_iface_opt() is not used outside capture_opts.c; make itGuy Harris1-1/+1
static. svn path=/trunk/; revision=41494
2012-03-11Add a comment to indicate what collect_ifaces() does.Guy Harris1-0/+4
svn path=/trunk/; revision=41490
2012-01-25Actually, you only have monitor mode support if you have pcap_create() -Guy Harris1-0/+2
without pcap_create() and pcap_activate() you don't have any API to turn it on. svn path=/trunk/; revision=40725
2012-01-25monitor_mode_enabled is only available on WIN32 or if we HAVE_PCAP_CREATE.Jeff Morriss1-2/+2
svn path=/trunk/; revision=40717
2012-01-25Third try. This time pipes and stdin are supported and theMichael Tüxen1-2/+53
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-214/+1
svn path=/trunk/; revision=40695
2012-01-24Second try. This time pipes and stdin are supported.Michael Tüxen1-1/+214
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
2011-12-29Add an additional DONT_HAVE_PCAP return value from get_interface_list()Guy Harris1-0/+2
and capture_interface_list(). Return it if, on Windows, we ask for the interface list but don't have WinPcap installed. Handle it like CANT_GET_INTERFACE_LIST. svn path=/trunk/; revision=40334
2011-10-20Back out infrastructure change. We missed supportingMichael Tüxen1-127/+1
stdin and pipes. svn path=/trunk/; revision=39498
2011-10-20Use a global list containing all interfaces and only changeMichael Tüxen1-1/+127
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=39495
2011-08-29Replace "-Q" with "WIRESHARK_QUIT_AFTER_CAPTURE" as discussed in bug 6256.Gerald Combs1-5/+1
svn path=/trunk/; revision=38784
2011-07-21Undo the checking of command line interfaces. It might the a pipe...Michael Tüxen1-56/+37
svn path=/trunk/; revision=38146
2011-07-21Make sure that the interfaces listed in ifaces really exist.Michael Tüxen1-37/+56
Some protection code in capture / options. Obtained from Irene Ruengeler. svn path=/trunk/; revision=38142
2011-07-11Having a non-NULL capture_opts->save_file might make us crash less.Gerald Combs1-0/+1
svn path=/trunk/; revision=37983
2011-07-11In version_info.c, assume we always have the "matches" operator. InGerald Combs1-6/+0
capture_opts.c, assume our output filename has been passed through arg_list_utf_16to8(). svn path=/trunk/; revision=37974
2011-06-30Oops, indented one of the "Promiscuous" ones.Guy Harris1-1/+1
svn path=/trunk/; revision=37850
2011-06-30Line up the colons.Guy Harris1-59/+59
svn path=/trunk/; revision=37849
2011-06-30It's not made from semolina. :-)Guy Harris1-2/+2
svn path=/trunk/; revision=37848
2011-06-30Cleanup.Michael Tüxen1-5/+1
svn path=/trunk/; revision=37840