Commit Graph

136 Commits

Author SHA1 Message Date
Guy Harris ca74add1c9 In capture_opts_add_iface_opt(), only *require* us to get the interface
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-21 18:11:57 +00:00
Guy Harris 4c019d6807 If we don't find the specified interface name in the list, use it
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-21 17:33:02 +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 fbaac1330a We don't use get_windows_interface_friendlyname() in capture_opts.c, so
we don't need to include capture_win_ifnames.h.

Clean up white space.

svn path=/trunk/; revision=46095
2012-11-20 01:12:57 +00:00
Jeff Morriss 92aff2d548 Failure to find the interface should cause *shark to exit with a status of 1, not 2.
svn path=/trunk/; revision=46089
2012-11-19 21:41:40 +00:00
Jeff Morriss 89c33a8266 As suggested by Evan: just make the variable a size_t instead of casting away the warning.
svn path=/trunk/; revision=46088
2012-11-19 21:32:39 +00:00
Jeff Morriss 06efe50e5f I'm pretty confident the string length will fit in 32 bits; cast away the "possible loss of data" warning on the Win64 build.
svn path=/trunk/; revision=46087
2012-11-19 21:00:44 +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
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
Irene Rüngeler bb1e018dc7 Fix for bug #7634. Print 'unspecified' in case a string is NULL.
svn path=/trunk/; revision=44512
2012-08-15 08:08:17 +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
ruengeler ea68381088 Remove lines that are not needed.
svn path=/trunk/; revision=42208
2012-04-23 13:47:45 +00:00
ruengeler 0819722ad8 Fix bug #7178 reported by aparan
svn path=/trunk/; revision=42206
2012-04-23 12:34:16 +00:00
Guy Harris fa64659e93 Closing a capture file has nothing to do with the list of interfaces on
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-13 03:48:27 +00:00
Guy Harris 3af7f28931 capture_opts_add_iface_opt() is not used outside capture_opts.c; make it
static.

svn path=/trunk/; revision=41494
2012-03-12 02:53:21 +00:00
Guy Harris 6f3ee54d62 Add a comment to indicate what collect_ifaces() does.
svn path=/trunk/; revision=41490
2012-03-11 20:01:11 +00:00
Guy Harris 1a5e1acdf3 Actually, you only have monitor mode support if you have pcap_create() -
without pcap_create() and pcap_activate() you don't have any API to turn
it on.

svn path=/trunk/; revision=40725
2012-01-25 19:40:22 +00:00
Jeff Morriss 91b873184f monitor_mode_enabled is only available on WIN32 or if we HAVE_PCAP_CREATE.
svn path=/trunk/; revision=40717
2012-01-25 14:29:09 +00:00
Michael Tüxen 14b1a44c0f Third try. This time pipes and stdin are supported and the
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-25 13:04:32 +00:00
Michael Tüxen 4fece25e7f We need a 3rd try. (After learning how to run the testuite on Windows locally).
svn path=/trunk/; revision=40695
2012-01-24 17:12:56 +00:00
Michael Tüxen 08d6785412 Second try. This time pipes and stdin are supported.
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
2012-01-24 16:05:26 +00:00
Guy Harris 3864d5d19d Add an additional DONT_HAVE_PCAP return value from get_interface_list()
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-12-29 22:49:49 +00:00
Michael Tüxen c219f2eea5 Back out infrastructure change. We missed supporting
stdin and pipes.




svn path=/trunk/; revision=39498
2011-10-20 19:44:40 +00:00
Michael Tüxen 95ae2fe13a 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=39495
2011-10-20 18:17:54 +00:00
Gerald Combs db240c2b5e Replace "-Q" with "WIRESHARK_QUIT_AFTER_CAPTURE" as discussed in bug 6256.
svn path=/trunk/; revision=38784
2011-08-29 21:16:29 +00:00
Michael Tüxen f98587d686 Undo the checking of command line interfaces. It might the a pipe...
svn path=/trunk/; revision=38146
2011-07-21 17:30:42 +00:00
Michael Tüxen 91df20357a Make sure that the interfaces listed in ifaces really exist.
Some protection code in capture / options.
Obtained from Irene Ruengeler.


svn path=/trunk/; revision=38142
2011-07-21 15:23:46 +00:00
Gerald Combs 8cbaab380e Having a non-NULL capture_opts->save_file might make us crash less.
svn path=/trunk/; revision=37983
2011-07-11 22:51:46 +00:00
Gerald Combs 5467d67f2a In version_info.c, assume we always have the "matches" operator. In
capture_opts.c, assume our output filename has been passed through
arg_list_utf_16to8().

svn path=/trunk/; revision=37974
2011-07-11 19:15:57 +00:00
Guy Harris 4bdb1926c5 Oops, indented one of the "Promiscuous" ones.
svn path=/trunk/; revision=37850
2011-06-30 23:34:53 +00:00
Guy Harris 88f7858de3 Line up the colons.
svn path=/trunk/; revision=37849
2011-06-30 22:41:54 +00:00
Guy Harris bf89288f87 It's not made from semolina. :-)
svn path=/trunk/; revision=37848
2011-06-30 22:21:16 +00:00
Michael Tüxen 185305aea6 Cleanup.
svn path=/trunk/; revision=37840
2011-06-30 06:31:52 +00:00
Michael Tüxen 52abc59011 Code cleanup.
svn path=/trunk/; revision=37820
2011-06-28 16:57:42 +00:00
Michael Tüxen 421dafd2de Get rid of old non-interface specific settings which are now interface
specifc. This finalizes the change of the infrastructure.
This patch is based on work by Irene Ruengeler.

svn path=/trunk/; revision=37794
2011-06-27 00:09:03 +00:00
Gerald Combs 8d88f3a790 Make pcap-ng the default. Add a compile-time option to prefer pcap-ng or
pcap.  Add a "-P" capture option which tries to use pcap instead of
pcap-ng ("-P" seemed to be the best option but we may want to use a
different letter).

Update the documentation and release notes.

svn path=/trunk/; revision=37696
2011-06-17 17:52:31 +00:00
Michael Tüxen 29c8afa6d3 Really print the rpcap username when logging, not
the rpcap password.
This only affects remote capturing.

svn path=/trunk/; revision=37681
2011-06-16 07:33:24 +00:00
Michael Tüxen 8f8f0e9ad6 Get rid of has_cfilter to simplify the handling of multiple interfaces.
svn path=/trunk/; revision=37478
2011-05-31 14:49:21 +00:00
Michael Tüxen d37d757dbc It is not an error (anymore) to specify multiple capture filters.
This was
wireshark -i lo0 -f sctp -i en0 -f udp -k
will work.

svn path=/trunk/; revision=37287
2011-05-19 11:58:18 +00:00
Michael Tüxen 70ae440e15 Make remote capturing settings a per interface thing. You can now
configure that you want to capture on multiple remote interfaces
on mulitple hosts.
Improve some #ifdef mess in dumpcap.

svn path=/trunk/; revision=37178
2011-05-16 15:19:54 +00:00
Michael Tüxen 122452f864 Make pcap samping a per interface setting.
Use consistent naming of variables on capture_options.
Make pcap sampling independent of remote capturing, since
it seems to work local pcap devices using winpcap (at
least that is what the documentation says).

svn path=/trunk/; revision=37176
2011-05-16 14:12:35 +00:00
Michael Tüxen 448fdb60b3 * Fix a bug when printing a pointer.
* Remove number_of_ifaces, since ifaces->len can be used instead.

svn path=/trunk/; revision=37174
2011-05-16 00:55:04 +00:00
Michael Tüxen cfe3d2d0da Get -L and -d working with multiple interface. Internally get some functions
using the array of interface data.
Improve output of -L by printing the interface name.

svn path=/trunk/; revision=37120
2011-05-13 11:28:51 +00:00
Michael Tüxen a80b7e5fea Use the same default value for the snaplen in the new array as in the
old way.

svn path=/trunk/; revision=37113
2011-05-13 06:04:28 +00:00
Michael Tüxen 2d6cd58f91 Add support for handling multiple interfaces as command line
parameters. An array of interface specific data is handled
in addition to the current way.
This change should not have any effect right now, it will
be used by dumpcap when supporting multiple interfaces
(and tshark/wireshark... in the future).


svn path=/trunk/; revision=37082
2011-05-12 16:54:16 +00:00
Michael Tüxen 93377f5236 Another whitespace cleanup.
svn path=/trunk/; revision=37076
2011-05-12 12:06:19 +00:00
Michael Tüxen 4b303018d1 Clean up some indentation. A purely whitespace change.
svn path=/trunk/; revision=37073
2011-05-12 10:58:14 +00:00
Guy Harris fb3f152076 Back out Jeff Morris's change to make the autostop file size 64-bit - it
didn't change the GUI code for setting the autostop file size, and that
broke the build.

svn path=/trunk/; revision=36552
2011-04-11 01:30:36 +00:00
Guy Harris 4ad4d3e678 Jeff Morris's change to make the autostop file size 64-bit. Fixes bug
5691.

svn path=/trunk/; revision=36551
2011-04-11 00:01:08 +00:00
Guy Harris 4fdcc5c180 Rename ws_stat to ws_stat64, and make it take a pointer to a ws_statb64
as an argument, along the lines of ws_fstat64, and, on Windows, make it
use _wstati64, to handle 64-bit file sizes.

svn path=/trunk/; revision=36547
2011-04-10 20:59:10 +00:00