summaryrefslogtreecommitdiff
path: root/capture_opts.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-04-15 23:30:30 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2017-04-25 06:19:39 +0000
commit77751c94f17e2c110ae9e88b1780e279d610b96b (patch)
treecd3a06ccf7944b3e131234ac86ae7b26ced8ea6b /capture_opts.c
parentcd55bd29258b8e0ffae9ea9471059b457ebb59ae (diff)
downloadwireshark-77751c94f17e2c110ae9e88b1780e279d610b96b.tar.gz
Qt: Add interface toolbar support
An extcap utility can provide configuration for controls to use in a GUI interface toolbar. This controls are bidirectional and can be used to control the extcap utility while capturing. This is useful in scenarios where configuration can be done based on findings in the capture process, setting temporary values or give other inputs without restarting current capture. Todo: - Add support for Windows Change-Id: Ie15fa67f92eb27d8b73df6bb36f66b9a7d81932d Reviewed-on: https://code.wireshark.org/review/19982 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'capture_opts.c')
-rw-r--r--capture_opts.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 69a24579c2..4a7c8f2ac2 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -68,6 +68,8 @@ capture_opts_init(capture_options *capture_opts)
capture_opts->default_options.extcap_args = NULL;
capture_opts->default_options.extcap_userdata = NULL;
capture_opts->default_options.extcap_pid = INVALID_EXTCAP_PID;
+ capture_opts->default_options.extcap_control_in = NULL;
+ capture_opts->default_options.extcap_control_out = NULL;
#endif
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
capture_opts->default_options.buffer_size = DEFAULT_CAPTURE_BUFFER_SIZE;
@@ -702,6 +704,8 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str
interface_opts.extcap_args = NULL;
interface_opts.extcap_pid = INVALID_EXTCAP_PID;
interface_opts.extcap_userdata = NULL;
+ interface_opts.extcap_control_in = g_strdup(capture_opts->default_options.extcap_control_in);
+ interface_opts.extcap_control_out = g_strdup(capture_opts->default_options.extcap_control_out);
#endif
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
interface_opts.buffer_size = capture_opts->default_options.buffer_size;
@@ -1129,6 +1133,8 @@ capture_opts_del_iface(capture_options *capture_opts, guint if_index)
if (interface_opts.extcap_pid != INVALID_EXTCAP_PID)
g_spawn_close_pid(interface_opts.extcap_pid);
g_free(interface_opts.extcap_userdata);
+ g_free(interface_opts.extcap_control_in);
+ g_free(interface_opts.extcap_control_out);
#endif
#ifdef HAVE_PCAP_REMOTE
if (interface_opts.src_type == CAPTURE_IFREMOTE) {
@@ -1180,6 +1186,8 @@ collect_ifaces(capture_options *capture_opts)
if (interface_opts.extcap_args)
g_hash_table_ref(interface_opts.extcap_args);
interface_opts.extcap_userdata = NULL;
+ interface_opts.extcap_control_in = NULL;
+ interface_opts.extcap_control_out = NULL;
#endif
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
interface_opts.buffer_size = device.buffer;