diff options
Diffstat (limited to 'capture_opts.c')
-rw-r--r-- | capture_opts.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/capture_opts.c b/capture_opts.c index 4ec0903af5..c70d42d0d8 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -142,9 +142,9 @@ capture_opts_log(const char *log_domain, GLogLevelFlags log_level, capture_optio interface_options interface_opts; 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); - g_log(log_domain, log_level, "Interface Descr[%02d] : %s", i, interface_opts.descr); - g_log(log_domain, log_level, "Capture filter[%02d] : %s", i, interface_opts.cfilter); + 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, "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); g_log(log_domain, log_level, "Promiscuous Mode[%02d]: %s", i, interface_opts.promisc_mode?"TRUE":"FALSE"); @@ -158,15 +158,15 @@ capture_opts_log(const char *log_domain, GLogLevelFlags log_level, capture_optio interface_opts.src_type == CAPTURE_IFREMOTE ? "Remote interface" : "Unknown"); if (interface_opts.src_type == CAPTURE_IFREMOTE) { - g_log(log_domain, log_level, "Remote host[%02d] : %s", i, interface_opts.remote_host); - g_log(log_domain, log_level, "Remote port[%02d] : %s", i, interface_opts.remote_port); + g_log(log_domain, log_level, "Remote host[%02d] : %s", i, interface_opts.remote_host ? interface_opts.remote_host : "(unspecified)"); + g_log(log_domain, log_level, "Remote port[%02d] : %s", i, interface_opts.remote_port ? interface_opts.remote_port : "(unspecified)"); } g_log(log_domain, log_level, "Authentication[%02d] : %s", i, interface_opts.auth_type == CAPTURE_AUTH_NULL ? "Null" : interface_opts.auth_type == CAPTURE_AUTH_PWD ? "By username/password" : "Unknown"); if (interface_opts.auth_type == CAPTURE_AUTH_PWD) { - g_log(log_domain, log_level, "Auth username[%02d] : %s", i, interface_opts.auth_username); + g_log(log_domain, log_level, "Auth username[%02d] : %s", i, interface_opts.auth_username ? interface_opts.auth_username : "(unspecified)"); g_log(log_domain, log_level, "Auth password[%02d] : <hidden>", i); } g_log(log_domain, log_level, "UDP data tfer[%02d] : %u", i, interface_opts.datatx_udp); @@ -178,9 +178,9 @@ capture_opts_log(const char *log_domain, GLogLevelFlags log_level, capture_optio g_log(log_domain, log_level, "Sampling param.[%02d] : %d", i, interface_opts.sampling_param); #endif } - g_log(log_domain, log_level, "Interface name[df] : %s", capture_opts->default_options.name); - g_log(log_domain, log_level, "Interface Descr[df] : %s", capture_opts->default_options.descr); - g_log(log_domain, log_level, "Capture filter[df] : %s", capture_opts->default_options.cfilter); + g_log(log_domain, log_level, "Interface name[df] : %s", capture_opts->default_options.name ? capture_opts->default_options.name : "(unspecified)"); + g_log(log_domain, log_level, "Interface Descr[df] : %s", capture_opts->default_options.descr ? capture_opts->default_options.descr : "(unspecified)"); + g_log(log_domain, log_level, "Capture filter[df] : %s", capture_opts->default_options.cfilter ? capture_opts->default_options.cfilter : "(unspecified)"); g_log(log_domain, log_level, "Snap length[df] (%u) : %d", capture_opts->default_options.has_snaplen, capture_opts->default_options.snaplen); g_log(log_domain, log_level, "Link Type[df] : %d", capture_opts->default_options.linktype); g_log(log_domain, log_level, "Promiscuous Mode[df]: %s", capture_opts->default_options.promisc_mode?"TRUE":"FALSE"); @@ -194,15 +194,15 @@ capture_opts_log(const char *log_domain, GLogLevelFlags log_level, capture_optio capture_opts->default_options.src_type == CAPTURE_IFREMOTE ? "Remote interface" : "Unknown"); if (capture_opts->default_options.src_type == CAPTURE_IFREMOTE) { - g_log(log_domain, log_level, "Remote host[df] : %s", capture_opts->default_options.remote_host); - g_log(log_domain, log_level, "Remote port[df] : %s", capture_opts->default_options.remote_port); + g_log(log_domain, log_level, "Remote host[df] : %s", capture_opts->default_options.remote_host ? capture_opts->default_options.remote_host : "(unspecified)"); + g_log(log_domain, log_level, "Remote port[df] : %s", capture_opts->default_options.remote_port ? capture_opts->default_options.remote_port : "(unspecified)"); } g_log(log_domain, log_level, "Authentication[df] : %s", capture_opts->default_options.auth_type == CAPTURE_AUTH_NULL ? "Null" : capture_opts->default_options.auth_type == CAPTURE_AUTH_PWD ? "By username/password" : "Unknown"); if (capture_opts->default_options.auth_type == CAPTURE_AUTH_PWD) { - g_log(log_domain, log_level, "Auth username[df] : %s", capture_opts->default_options.auth_username); + g_log(log_domain, log_level, "Auth username[df] : %s", capture_opts->default_options.auth_username ? capture_opts->default_options.auth_username : "(unspecified)"); g_log(log_domain, log_level, "Auth password[df] : <hidden>"); } g_log(log_domain, log_level, "UDP data tfer[df] : %u", capture_opts->default_options.datatx_udp); |