Commit Graph

311 Commits

Author SHA1 Message Date
Michael Tüxen 10dbe80c65 Add support for writing the flags option in the enhanced
packet block (pcapng).

svn path=/trunk/; revision=46619
2012-12-19 20:27:12 +00:00
Anders Broman 2977bde9f1 - Make dumpcap build with the new bundle.
- Use the correct bundle id for GTK3

svn path=/trunk/; revision=46586
2012-12-18 11:58:22 +00:00
Jeff Morriss 20211340e5 Make the "-g" argument to tshark actually work (by passing it to dumpcap).
svn path=/trunk/; revision=46515
2012-12-12 03:25:35 +00:00
Jeff Morriss 05ee001d73 Document the "-g" option to dumpcap.
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-12 02:07:08 +00:00
Stephen Fisher 0537be2e5e Change variable "devname" to "devicename" in numerous places to avoid
to avoid -Wshadow warnings about conflicting with BSD's devname()
function.


svn path=/trunk/; revision=46494
2012-12-10 23:53:09 +00:00
Bill Meier 552323e7fb Fix a number of [-Wshadow] warnings;
Also: Do some minor whitespace changes

svn path=/trunk/; revision=46182
2012-11-25 18:35:41 +00:00
Guy Harris bd976ae6c0 On UN*X, if an interface has a description, use it as the "friendly
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-22 06:02:49 +00:00
Guy Harris d415d3d87c On error, have capture_opts_trim_iface() return the exit status that
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-21 17:14:54 +00:00
Guy Harris 03f4fa5223 Make the "Invalid capture filter" message resemble that of other programs.
svn path=/trunk/; revision=46107
2012-11-21 16:05:21 +00:00
Anders Broman 28474fe8ef From Mike Garratt:
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-11-19 20:07:27 +00:00
Bill Meier 68aeb27b90 (Trivial): update a comment.
svn path=/trunk/; revision=45287
2012-10-03 15:42:41 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Evan Huus bcf6e79573 Convert inpkts_to_sync_pipe and report_packet_count() to use unsigned ints
consistently. Cleans up some cppcheck warnings about signed/unsigned mismatches
in format strings.

svn path=/trunk/; revision=44818
2012-09-09 13:57:43 +00:00
Michael Tüxen 11c86ec476 Update recv/drop counters also when no threads are used.
This should fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7523

svn path=/trunk/; revision=43981
2012-07-25 07:08:20 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Guy Harris 2851255f53 Don't supply a fallback error message for pcap_open() unless it actually
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-27 05:13:06 +00:00
Jörg Mayer 2b6b0656c2 Pontus Fuchs via bug 6973:
Add last piece of the wireless toolbar: Use dumpcap to actually set
the channel.

svn path=/trunk/; revision=43466
2012-06-24 19:45:49 +00:00
Jörg Mayer 3685b4db6f Remove some trailing whitespace
svn path=/trunk/; revision=43425
2012-06-21 13:23:45 +00:00
Michael Tüxen 1b0a5c58e2 Fix compilation on FreeBSD.
svn path=/trunk/; revision=43343
2012-06-18 21:50:59 +00:00
Chris Maynard c3dadc73f3 Fix Coverity CID 708961: Resource leak, by closing the socket if the 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-09 03:36:15 +00:00
Chris Maynard 11204066a8 Some minimal documentation of remote capture interface formats for both rpcap and the new TCP feature from bug 2788.
svn path=/trunk/; revision=43156
2012-06-08 13:55:14 +00:00
Chris Maynard 74f85a07c0 Add another cast to make Windows buildbots happy.
svn path=/trunk/; revision=43155
2012-06-08 13:23:14 +00:00
Anders Broman 14c0648ce4 Add a cast.
svn path=/trunk/; revision=43154
2012-06-08 12:27:22 +00:00
Anders Broman 6a1f6be63b From Alexey Neyman Forward ported by Michael Mann:
Allow captures over TCP connections.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2788

svn path=/trunk/; revision=43153
2012-06-08 11:54:26 +00:00
Chris Maynard 6272bd1578 In cap_pipe_open_live(), be sure to call ws_close(fd) before returning due to a couple of error condtions. Fixes Coverity CID 702395 Resource leak.
svn path=/trunk/; revision=42844
2012-05-25 01:32:26 +00:00
Guy Harris fb8054f131 Expand a comment.
Clear the struct sigaction *before* we fill in any fields in it.

svn path=/trunk/; revision=42706
2012-05-18 04:06:35 +00:00
Gerald Combs bdb614e264 Fix a bunch of uninitialized variables found by Coverity Scan. CIDs
702403, 702404, 702405, 702406, 702407, 702408, 702409, 702410, 702411,
and 702412.

svn path=/trunk/; revision=42658
2012-05-16 16:29:12 +00:00
Bill Meier 9d4b7ad9fe From Evan Huus:
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-05-07 00:49:39 +00:00
Michael Tüxen e08a45d705 Set also the pcap buffer, if the default of 1 MB is used. This bug was
reported by Guy.

svn path=/trunk/; revision=42246
2012-04-25 21:19:31 +00:00
Michael Tüxen 3c866b04d0 Report the packets captured and the packets dropped (either by libpcap or by dumpcap).
svn path=/trunk/; revision=42245
2012-04-25 21:09:33 +00:00
Michael Tüxen 8ea1984ddc Allow writing ISB with given recv/drop counters.
No functional change by this commit.

svn path=/trunk/; revision=42242
2012-04-25 20:50:38 +00:00
Michael Tüxen d2526de5f8 Fix the packet counters.
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-25 17:43:44 +00:00
Michael Tüxen 0fe7859ca4 Fix locking problem.
svn path=/trunk/; revision=42235
2012-04-25 16:05:29 +00:00
Guy Harris 04cd90e99e From Evan Huus: add a missing free. Fixes bug 7092.
svn path=/trunk/; revision=42070
2012-04-14 17:45:03 +00:00
Guy Harris 5ef71a27ff Fix tpo.
svn path=/trunk/; revision=41941
2012-04-04 19:46:45 +00:00
Guy Harris 43ca745bb9 Work around that WinPcap bug for another pcap_open() call.
svn path=/trunk/; revision=41938
2012-04-04 19:26:07 +00:00
Guy Harris 9c781b0939 Work around WinPcap bug wherein pcap_open() returns -1 without putting
an error message into errbuf (the bug has been reported to
winpcap-bugs).

Should fix bug 6922.

svn path=/trunk/; revision=41937
2012-04-04 19:13:39 +00:00
Anders Broman ba7c0cb1b9 From Jose Pedro Oliveira:
dumpcap.c: code cleaning 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6718

svn path=/trunk/; revision=41535
2012-03-13 15:27:22 +00:00
Anders Broman cbde63643e From Jose Pedro Oliveira:
Enforce the modelines in dumpcap.c and in pcapio.c

svn path=/trunk/; revision=41505
2012-03-12 15:40:57 +00:00
Guy Harris 6486942282 Fix function name in debugging message.
svn path=/trunk/; revision=41488
2012-03-11 19:59:08 +00:00
Gerald Combs 7a8df2f485 In pcapng.c use the units per second value from the interface instead of
the default.

Add support for reading nseclibpcap files to dumpcap.

svn path=/trunk/; revision=41455
2012-03-10 00:24:42 +00:00
Anders Broman bb71a9c96a Forward interface_opts.descr (currently empty) when writing IDB:s
svn path=/trunk/; revision=41454
2012-03-09 15:29:35 +00:00
Anders Broman 9d03324d91 From Jose Pedro Oliveira: Make dumpcap write the if_tsresol option (using the default value) https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6718
svn path=/trunk/; revision=41444
2012-03-09 05:02:27 +00:00
Gerald Combs 57eeea4b20 Add a note about using GetSystemTimePreciseAsFileTime.
svn path=/trunk/; revision=41382
2012-03-06 21:11:31 +00:00
Guy Harris 26f694ddee Fix comment.
svn path=/trunk/; revision=41347
2012-03-05 06:43:44 +00:00
Anders Broman ad6640344f From Jose Pedro Oliveira: Fix typos
svn path=/trunk/; revision=41330
2012-03-03 16:17:20 +00:00
Gerald Combs 8334ec2b43 Another small commit to test migration.
svn path=/trunk/; revision=41251
2012-03-01 02:18:35 +00:00
Gerald Combs 380f3f54a7 Add a comment noting that we need to add support for files with
nanosecond timestamps. (Also test the recent anonymous repository
migration.)

svn path=/trunk/; revision=41248
2012-02-29 20:32:12 +00:00
Michael Tüxen 050c0a14c9 Don't use deprecated API on glib 2.31.18 and higher.
This should fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6884

svn path=/trunk/; revision=41247
2012-02-29 18:04:23 +00:00
Michael Tüxen 412c5a903c As discussed with Anders: Only write a single ISB at the end. Proivde
start/end time in the ISBs.

svn path=/trunk/; revision=41160
2012-02-23 12:57:17 +00:00