diff options
author | tuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-06-27 00:09:03 +0000 |
---|---|---|
committer | tuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-06-27 00:09:03 +0000 |
commit | 9d78645e53343caa65978ac7d95525ee715f70bd (patch) | |
tree | bb643894194a390b834607109790faa403b74982 /capture_ui_utils.c | |
parent | 58316c299a25992d65b7cb598021c254c2cb3acc (diff) |
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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37794 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_ui_utils.c')
-rw-r--r-- | capture_ui_utils.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/capture_ui_utils.c b/capture_ui_utils.c index 90b8b435bc..1ebe978c68 100644 --- a/capture_ui_utils.c +++ b/capture_ui_utils.c @@ -395,33 +395,26 @@ get_if_name(const char *if_text) return if_name; } -/* Return capture_opts->iface_descr (after setting it if it is not set) - * This is necessary because capture_opts.c can't set iface_descr (at least +/* Return interface_opts->descr (after setting it if it is not set) + * This is necessary because capture_opts.c can't set descr (at least * not without adding significant dependencies there). */ const char * -get_iface_description(capture_options *capture_opts) -{ - if (!capture_opts->iface_descr && capture_opts->iface) - capture_opts->iface_descr = get_interface_descriptive_name(capture_opts->iface); - - return(capture_opts->iface_descr); - -} - -const char * get_iface_description_for_interface(capture_options *capture_opts, guint i) { - interface_options interface_opts; - - interface_opts = g_array_index(capture_opts->ifaces, interface_options, i); - if (!interface_opts.descr && interface_opts.name) { - interface_opts.descr = get_interface_descriptive_name(interface_opts.name); - } - capture_opts->ifaces = g_array_remove_index(capture_opts->ifaces, i); - g_array_insert_val(capture_opts->ifaces, i, interface_opts); - - return (interface_opts.descr); + interface_options interface_opts; + + if (i < capture_opts->ifaces->len) { + interface_opts = g_array_index(capture_opts->ifaces, interface_options, i); + if (!interface_opts.descr && interface_opts.name) { + interface_opts.descr = get_interface_descriptive_name(interface_opts.name); + capture_opts->ifaces = g_array_remove_index(capture_opts->ifaces, i); + g_array_insert_val(capture_opts->ifaces, i, interface_opts); + } + return (interface_opts.descr); + } else { + return (NULL); + } } #endif /* HAVE_LIBPCAP */ |