summaryrefslogtreecommitdiff
path: root/capture_win_ifnames.c
AgeCommit message (Collapse)AuthorFilesLines
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^\* \$Id\$/,+1 d') (no space before star) Change-Id: I318968db2b8512ba1303b5fc5c624c66441658f0 Reviewed-on: https://code.wireshark.org/review/879 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-10-20Use SecureZeroMemory instead of plain ZeroMemory because checkAPI says to.Evan Huus1-1/+1
svn path=/trunk/; revision=52727
2013-10-20From RobiOneKenobi via ↵Pascal Quantin1-0/+16
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9297 : Add support for MSVC2013 svn path=/trunk/; revision=52716
2012-11-24Put the code to convert a GUID string to a GUID structure into a routineGuy Harris1-145/+161
of its own. Export that routine from capture_win_ifnames.c. Rename GetInterfaceFriendlyNameFromDeviceGuid() to get_interface_friendly_name_from_device_guid(), to match the style of names of the other routines exported from capture_win_ifnames.c, and export it as well. Have if_info_new() use those routines, and, if parse_as_guid() fails, treat the "description" as a friendly name rather than a vendor description, so that we don't have a vendor description for, for example, the device offered on some versions of Windows to handle dial-up devices. svn path=/trunk/; revision=46170
2012-11-24There is no longer an interface_friendlyname argument toGuy Harris1-7/+0
get_windows_interface_friendly_name(); don't refer to it. svn path=/trunk/; revision=46163
2012-11-24Constify argument to get_windows_interface_friendly_name().Guy Harris1-1/+1
svn path=/trunk/; revision=46162
2012-11-24Rename get_windows_interface_friendlyname() toGuy Harris1-117/+36
get_windows_interface_friendly_name(), and have it return the friendly name on success and NULL on failure. Get rid of the logging in get_windows_interface_friendly_name(). svn path=/trunk/; revision=46161
2012-11-23Try to fix Windows compilationPascal Quantin1-1/+1
svn path=/trunk/; revision=46160
2012-11-23'if 0' wrapping of config.h no longer required;Bill Meier1-3/+1
Also, '#include winsock2.h' should be before '#include windows.h' Based upon information provided by Gisle Vanem. See https://www.wireshark.org/lists/wireshark-dev/201211/msg00096.html and message thread starting at https://www.wireshark.org/lists/wireshark-dev/201211/msg00108.html svn path=/trunk/; revision=46155
2012-11-23We don't need ole32.lib any more; don't link with it and don't include aGuy Harris1-5/+8
header file for it. We also don't monkey around with wide characters any more, so don't include <tchar.h>. Depending on the SDK you're using and/or the version of Windows on which you're building, NDIS_IF_MAX_STRING_SIZE and NETIO_STATUS might not be defined; define them if not. Thanks to Gisle Vanem for that fix. svn path=/trunk/; revision=46150
2012-11-23Parse the GUID ourselves; that leaves fewer error cases to worry about,Guy Harris1-33/+133
and thus fewer places where we would need to report an error rather than just saying "well, this name doesn't end in a GUID, so it doesn't correspond to an interface whose friendly name we can ask for". svn path=/trunk/; revision=46149
2012-11-22If the interface name doesn't contain a valid GUID string, that's *not*Guy Harris1-11/+20
an error - not all interface names contain GUIDs (e.g., AirPcap devices, or \Device\NPF_GenericDialupAdapter). Don't log a message in that case, just say "sorry, no friendly name". Get rid of a g_log() call and fflush() calls that look as if they were copied-and-pasted from sync pipe code. Correct some comments. svn path=/trunk/; revision=46148
2012-11-21When dumpcap is being run by another program, its standard error getsGuy Harris1-3/+1
consumed by that program, and that program only ends up reporting one of those errors. Therefore, only log one of them; we're seeing errors in the buildbot, and we want the more detailed error, so don't log a message after GetInterfaceFriendlyNameFromDeviceGuid() returns an error, just rely on the error logged by GetInterfaceFriendlyNameFromDeviceGuid(). Ultimately, we don't want to print anything to the standard output or error at all, as that stuff ends up being consumed by the program in question; we should either ignore the error (if it's an "expected" error) or report it through the API so the the caller can, in turn, report it appropriately. svn path=/trunk/; revision=46099
2012-11-19Including config.h causes compile errors; Comment out for now...Bill Meier1-0/+2
svn path=/trunk/; revision=46094
2012-11-19HAVE_CONFIG_H no longer req'dBill Meier1-44/+42
svn path=/trunk/; revision=46093
2012-11-19From Mike Garratt:Anders Broman1-0/+319
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