aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--capture_opts.c5
-rw-r--r--capture_opts.h1
-rw-r--r--ui/gtk/capture_dlg.c3
-rw-r--r--ui/iface_lists.c3
-rw-r--r--ui/qt/manage_interfaces_dialog.cpp2
5 files changed, 14 insertions, 0 deletions
diff --git a/capture_opts.c b/capture_opts.c
index a5470904c2..29bb484b20 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -810,9 +810,11 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg_
interface_opts = g_array_index(capture_opts->ifaces, interface_options, capture_opts->ifaces->len - 1);
capture_opts->ifaces = g_array_remove_index(capture_opts->ifaces, capture_opts->ifaces->len - 1);
+ g_free(interface_opts.timestamp_type);
interface_opts.timestamp_type = g_strdup(optarg_str_p);
g_array_append_val(capture_opts->ifaces, interface_opts);
} else {
+ g_free(capture_opts->default_options.timestamp_type);
capture_opts->default_options.timestamp_type = g_strdup(optarg_str_p);
}
break;
@@ -1161,6 +1163,7 @@ capture_opts_del_iface(capture_options *capture_opts, guint if_index)
if (interface_opts.console_display_name != NULL)
g_free(interface_opts.console_display_name);
g_free(interface_opts.cfilter);
+ g_free(interface_opts.timestamp_type);
#ifdef HAVE_EXTCAP
g_free(interface_opts.extcap);
g_free(interface_opts.extcap_fifo);
@@ -1209,6 +1212,7 @@ collect_ifaces(capture_options *capture_opts)
interface_opts.console_display_name = g_strdup(device.name);
interface_opts.linktype = device.active_dlt;
interface_opts.cfilter = g_strdup(device.cfilter);
+ interface_opts.timestamp_type = g_strdup(device.timestamp_type);
interface_opts.snaplen = device.snaplen;
interface_opts.has_snaplen = device.has_snaplen;
interface_opts.promisc_mode = device.pmode;
@@ -1277,6 +1281,7 @@ capture_opts_free_interface_t(interface_t *device)
g_free(device->friendly_name);
g_free(device->addresses);
g_free(device->cfilter);
+ g_free(device->timestamp_type);
g_list_foreach(device->links,
capture_opts_free_interface_t_links, NULL);
g_list_free(device->links);
diff --git a/capture_opts.h b/capture_opts.h
index c3b830e3b3..8e1cb8de2a 100644
--- a/capture_opts.h
+++ b/capture_opts.h
@@ -201,6 +201,7 @@ typedef struct interface_tag {
/* External capture cached data */
GHashTable *external_cap_args_settings;
#endif
+ gchar *timestamp_type;
} interface_t;
typedef struct link_row_tag {
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c
index c79ff4d4d0..363746d2a3 100644
--- a/ui/gtk/capture_dlg.c
+++ b/ui/gtk/capture_dlg.c
@@ -1302,6 +1302,7 @@ insert_new_rows(GList *rlist)
device.snaplen = global_capture_opts.default_options.snaplen;
}
device.cfilter = g_strdup(global_capture_opts.default_options.cfilter);
+ device.timestamp_type = g_strdup(global_capture_opts.default_options.timestamp_type);
monitor_mode = prefs_capture_device_monitor_mode(if_string);
if (roptions->remote_host_opts.auth_type == CAPTURE_AUTH_PWD) {
auth_str = g_strdup_printf("%s:%s", roptions->remote_host_opts.auth_username,
@@ -2656,6 +2657,7 @@ void options_interface_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColum
device.has_snaplen = FALSE;
device.snaplen = WTAP_MAX_PACKET_SIZE_STANDARD;
device.cfilter = NULL;
+ device.timestamp_type = NULL;
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
device.buffer = DEFAULT_CAPTURE_BUFFER_SIZE;
#endif
@@ -3507,6 +3509,7 @@ add_pipe_cb(gpointer w _U_)
device.has_snaplen = global_capture_opts.default_options.has_snaplen;
device.snaplen = global_capture_opts.default_options.snaplen;
device.cfilter = g_strdup(global_capture_opts.default_options.cfilter);
+ device.timestamp_type = g_strdup(global_capture_opts.default_options.timestamp_type);
device.addresses = NULL;
device.no_addresses = 0;
device.last_packets = 0;
diff --git a/ui/iface_lists.c b/ui/iface_lists.c
index dddecf4d27..bf02dc6765 100644
--- a/ui/iface_lists.c
+++ b/ui/iface_lists.c
@@ -80,6 +80,7 @@ fill_from_ifaces (interface_t *device)
device->snaplen = interface_opts.snaplen;
g_free(device->cfilter);
device->cfilter = g_strdup(interface_opts.cfilter);
+ device->timestamp_type = g_strdup(interface_opts.timestamp_type);
if (interface_opts.linktype != -1) {
device->active_dlt = interface_opts.linktype;
}
@@ -304,6 +305,7 @@ scan_local_interfaces(void (*update_cb)(void))
device.snaplen = global_capture_opts.default_options.snaplen;
}
device.cfilter = g_strdup(global_capture_opts.default_options.cfilter);
+ device.timestamp_type = g_strdup(global_capture_opts.default_options.timestamp_type);
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
if ((device.buffer = capture_dev_user_buffersize_find(if_info->name)) == -1) {
device.buffer = global_capture_opts.default_options.buffer_size;
@@ -372,6 +374,7 @@ scan_local_interfaces(void (*update_cb)(void))
device.has_snaplen = interface_opts.has_snaplen;
device.snaplen = interface_opts.snaplen;
device.cfilter = g_strdup(interface_opts.cfilter);
+ device.timestamp_type = g_strdup(interface_opts.timestamp_type);
device.active_dlt = interface_opts.linktype;
device.addresses = NULL;
device.no_addresses = 0;
diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp
index 6e7714eb73..d36d5521a0 100644
--- a/ui/qt/manage_interfaces_dialog.cpp
+++ b/ui/qt/manage_interfaces_dialog.cpp
@@ -234,6 +234,7 @@ void ManageInterfacesDialog::on_addPipe_clicked()
device.has_snaplen = global_capture_opts.default_options.has_snaplen;
device.snaplen = global_capture_opts.default_options.snaplen;
device.cfilter = g_strdup(global_capture_opts.default_options.cfilter);
+ device.timestamp_type = g_strdup(global_capture_opts.default_options.timestamp_type);
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
device.buffer = DEFAULT_CAPTURE_BUFFER_SIZE;
#endif
@@ -350,6 +351,7 @@ void ManageInterfacesDialog::updateRemoteInterfaceList(GList* rlist, remote_opti
device.snaplen = global_capture_opts.default_options.snaplen;
}
device.cfilter = g_strdup(global_capture_opts.default_options.cfilter);
+ device.timestamp_type = g_strdup(global_capture_opts.default_options.timestamp_type);
monitor_mode = prefs_capture_device_monitor_mode(if_string);
if (roptions->remote_host_opts.auth_type == CAPTURE_AUTH_PWD) {
auth_str = g_strdup_printf("%s:%s", roptions->remote_host_opts.auth_username,