forked from osmocom/wireshark
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
This commit is contained in:
parent
b604e9c4cc
commit
fbaac1330a
|
@ -50,10 +50,6 @@
|
|||
#include "capture-pcap-util.h"
|
||||
#include <wsutil/file_util.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "capture_win_ifnames.h" /* windows friendly interface names */
|
||||
#endif
|
||||
|
||||
static gboolean capture_opts_output_to_pipe(const char *save_file, gboolean *is_pipe);
|
||||
|
||||
|
||||
|
@ -145,8 +141,8 @@ capture_opts_log(const char *log_domain, GLogLevelFlags log_level, capture_optio
|
|||
|
||||
interface_opts = g_array_index(capture_opts->ifaces, interface_options, i);
|
||||
g_log(log_domain, log_level, "Interface name[%02d] : %s", i, interface_opts.name ? interface_opts.name : "(unspecified)");
|
||||
g_log(log_domain, log_level, "Interface Descr[%02d] : %s", i, interface_opts.descr ? interface_opts.descr : "(unspecified)");
|
||||
g_log(log_domain, log_level, "Con display name[%02d]: %s", i, interface_opts.console_display_name ? interface_opts.console_display_name : "(unspecified)");
|
||||
g_log(log_domain, log_level, "Interface description[%02d] : %s", i, interface_opts.descr ? interface_opts.descr : "(unspecified)");
|
||||
g_log(log_domain, log_level, "Console display name[%02d]: %s", i, interface_opts.console_display_name ? interface_opts.console_display_name : "(unspecified)");
|
||||
g_log(log_domain, log_level, "Capture filter[%02d] : %s", i, interface_opts.cfilter ? interface_opts.cfilter : "(unspecified)");
|
||||
g_log(log_domain, log_level, "Snap length[%02d] (%u) : %d", i, interface_opts.has_snaplen, interface_opts.snaplen);
|
||||
g_log(log_domain, log_level, "Link Type[%02d] : %d", i, interface_opts.linktype);
|
||||
|
@ -499,7 +495,13 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str
|
|||
}
|
||||
interface_opts.name = g_strdup(if_info->name);
|
||||
if (if_info->friendly_name != NULL) {
|
||||
/* we know the friendlyname, so display that instead of the interface name/guid */
|
||||
/*
|
||||
* We have a friendly name for the interface, so display that
|
||||
* instead of the interface name/guid.
|
||||
*
|
||||
* XXX - on UN*X, the interface name is not quite so ugly,
|
||||
* and might be more familiar to users; display them both?
|
||||
*/
|
||||
interface_opts.console_display_name = g_strdup(if_info->friendly_name);
|
||||
} else {
|
||||
/* fallback to the interface name */
|
||||
|
@ -521,8 +523,11 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str
|
|||
interface_opts.name = g_strdup(if_info->name);
|
||||
|
||||
if (if_info->friendly_name != NULL) {
|
||||
/* if we know a friendly_name, use that for console_display_name, as
|
||||
* it is the basis for the auto generated temp filename */
|
||||
/*
|
||||
* If we have a friendly name, use that for the
|
||||
* console display name, as it is the basis for
|
||||
* the auto generated temp filename.
|
||||
*/
|
||||
interface_opts.console_display_name = g_strdup(if_info->friendly_name);
|
||||
} else {
|
||||
interface_opts.console_display_name = g_strdup(if_info->name);
|
||||
|
@ -532,7 +537,8 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str
|
|||
}
|
||||
|
||||
/* exact friendly name check */
|
||||
if(if_info->friendly_name!=NULL && g_ascii_strcasecmp(if_info->friendly_name, optarg_str_p)==0){
|
||||
if (if_info->friendly_name != NULL &&
|
||||
g_ascii_strcasecmp(if_info->friendly_name, optarg_str_p) == 0) {
|
||||
/* exact match - use the friendly name for display */
|
||||
interface_opts.name = g_strdup(if_info->name);
|
||||
interface_opts.console_display_name = g_strdup(if_info->friendly_name);
|
||||
|
@ -550,7 +556,8 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str
|
|||
{
|
||||
if_info = (if_info_t *)if_entry->data;
|
||||
|
||||
if(if_info->friendly_name!=NULL && g_ascii_strncasecmp(if_info->friendly_name, optarg_str_p, prefix_length)==0){
|
||||
if (if_info->friendly_name != NULL &&
|
||||
g_ascii_strncasecmp(if_info->friendly_name, optarg_str_p, prefix_length) == 0) {
|
||||
/* prefix match - use the friendly name for display */
|
||||
interface_opts.name = g_strdup(if_info->name);
|
||||
interface_opts.console_display_name = g_strdup(if_info->friendly_name);
|
||||
|
@ -912,16 +919,14 @@ gboolean capture_opts_trim_iface(capture_options *capture_opts, const char *capt
|
|||
if (capture_device != NULL) {
|
||||
/* Yes - use it. */
|
||||
status = capture_opts_add_iface_opt(capture_opts, capture_device);
|
||||
if(status==0){
|
||||
if (status == 0)
|
||||
return TRUE; /* interface found */
|
||||
}
|
||||
return FALSE; /* some kind of error finding interface */
|
||||
}
|
||||
/* No default in preferences file, just pick the first interface from the list of interfaces. */
|
||||
status = capture_opts_add_iface_opt(capture_opts, "1");
|
||||
if(status==0){
|
||||
if (status == 0)
|
||||
return TRUE; /* success */
|
||||
}
|
||||
return FALSE; /* some kind of error finding the first interface */
|
||||
}
|
||||
|
||||
|
@ -1003,9 +1008,8 @@ collect_ifaces(capture_options *capture_opts)
|
|||
interface_opts = g_array_index(capture_opts->ifaces, interface_options, i - 1);
|
||||
g_free(interface_opts.name);
|
||||
g_free(interface_opts.descr);
|
||||
if(interface_opts.console_display_name!=NULL){
|
||||
if (interface_opts.console_display_name != NULL)
|
||||
g_free(interface_opts.console_display_name);
|
||||
}
|
||||
g_free(interface_opts.cfilter);
|
||||
#ifdef HAVE_PCAP_REMOTE
|
||||
if (interface_opts.src_type == CAPTURE_IFREMOTE) {
|
||||
|
|
Loading…
Reference in New Issue