TLS13: update pre_shared_key lengths for draft -19
[metze/wireshark/wip.git] / capture_opts.c
index e014290f351bcb8c80a275e8adef6e2b40b9430b..3b0f77c99e6050407b6423406e77fef51dc939d8 100644 (file)
@@ -121,6 +121,21 @@ capture_opts_init(capture_options *capture_opts)
     capture_opts->capture_child                   = FALSE;
 }
 
+void
+capture_opts_cleanup(capture_options *capture_opts)
+{
+    if (!capture_opts)
+        return;
+
+    if (capture_opts->ifaces) {
+        g_array_free(capture_opts->ifaces, TRUE);
+        capture_opts->ifaces = NULL;
+    }
+    if (capture_opts->all_ifaces) {
+        g_array_free(capture_opts->all_ifaces, TRUE);
+        capture_opts->all_ifaces = NULL;
+    }
+}
 
 /* log content of capture_opts */
 void
@@ -270,7 +285,7 @@ set_autostop_criterion(capture_options *capture_opts, const char *autostoparg)
         capture_opts->autostop_duration = get_positive_int(p,"autostop duration");
     } else if (strcmp(autostoparg,"filesize") == 0) {
         capture_opts->has_autostop_filesize = TRUE;
-        capture_opts->autostop_filesize = get_positive_int(p,"autostop filesize");
+        capture_opts->autostop_filesize = get_nonzero_guint32(p,"autostop filesize");
     } else if (strcmp(autostoparg,"files") == 0) {
         capture_opts->multi_files_on = TRUE;
         capture_opts->has_autostop_files = TRUE;
@@ -373,10 +388,10 @@ get_ring_arguments(capture_options *capture_opts, const char *arg)
 
     if (strcmp(arg,"files") == 0) {
         capture_opts->has_ring_num_files = TRUE;
-        capture_opts->ring_num_files = get_positive_int(p, "number of ring buffer files");
+        capture_opts->ring_num_files = get_nonzero_guint32(p, "number of ring buffer files");
     } else if (strcmp(arg,"filesize") == 0) {
         capture_opts->has_autostop_filesize = TRUE;
-        capture_opts->autostop_filesize = get_positive_int(p, "ring buffer filesize");
+        capture_opts->autostop_filesize = get_nonzero_guint32(p, "ring buffer filesize");
     } else if (strcmp(arg,"duration") == 0) {
         capture_opts->has_file_duration = TRUE;
         capture_opts->file_duration = get_positive_int(p, "ring buffer duration");