aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-03-24 23:36:29 -0700
committerGuy Harris <gharris@sonic.net>2021-03-25 07:34:37 +0000
commitd18e1f19e9de19a76647f4df46b83a60be47e785 (patch)
tree66a0b0730c59e3d16eeed4e4f76d74d1c659d3b3 /capture_opts.c
parentecad065809553e77b1c459e377068eba3e336d03 (diff)
Add dumpcap options to set the name and description for a capture source.
Add --ifname and --ifdescr to allow the name and description for an interface or pipe to be set; this overrides the specified name or reported description for an interface, and overrides the pipe path name and provides a description for a pipe. Provide those arguments when capturing from an extcap program. This is mainly for extcaps, so you have something more meaningful than some random path name as the interface name and something descriptive for the description.
Diffstat (limited to 'capture_opts.c')
-rw-r--r--capture_opts.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 48a7a81b1d..ac08fcf687 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -563,6 +563,7 @@ fill_in_interface_opts_from_ifinfo(interface_options *interface_opts,
interface_opts->descr = NULL;
interface_opts->display_name = g_strdup(if_info->name);
}
+ interface_opts->ifname = NULL;
interface_opts->if_type = if_info->type;
interface_opts->extcap = g_strdup(if_info->extcap);
}
@@ -740,6 +741,7 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str
interface_opts.descr = NULL;
interface_opts.hardware = NULL;
interface_opts.display_name = g_strdup(optarg_str_p);
+ interface_opts.ifname = NULL;
interface_opts.if_type = capture_opts->default_options.if_type;
interface_opts.extcap = g_strdup(capture_opts->default_options.extcap);
}
@@ -1206,6 +1208,7 @@ capture_opts_del_iface(capture_options *capture_opts, guint if_index)
g_free(interface_opts->descr);
g_free(interface_opts->hardware);
g_free(interface_opts->display_name);
+ g_free(interface_opts->ifname);
g_free(interface_opts->cfilter);
g_free(interface_opts->timestamp_type);
g_free(interface_opts->extcap);