#include "config.h"
#include <stdio.h>
+#include <stdlib.h>
#ifdef HAVE_LIBPCAP
capture_opts->default_options.cfilter = NULL;
capture_opts->default_options.has_snaplen = FALSE;
capture_opts->default_options.snaplen = WTAP_MAX_PACKET_SIZE;
- capture_opts->default_options.linktype = -1;
+ capture_opts->default_options.linktype = -1; /* use interface default */
capture_opts->default_options.promisc_mode = TRUE;
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
capture_opts->default_options.buffer_size = DEFAULT_CAPTURE_BUFFER_SIZE;
capture_opts->show_info = TRUE;
capture_opts->quit_after_cap = getenv("WIRESHARK_QUIT_AFTER_CAPTURE") ? TRUE : FALSE;
capture_opts->restart = FALSE;
+ capture_opts->orig_save_file = NULL;
capture_opts->multi_files_on = FALSE;
capture_opts->has_file_duration = FALSE;
capture_opts->has_autostop_packets = FALSE;
capture_opts->autostop_packets = 0;
capture_opts->has_autostop_filesize = FALSE;
- capture_opts->autostop_filesize = 1024; /* 1 MB */
+ capture_opts->autostop_filesize = 1000; /* 1 MB */
capture_opts->has_autostop_duration = FALSE;
capture_opts->autostop_duration = 60; /* 1 min */
capture_opts->capture_comment = NULL;
int status, snaplen;
switch(opt) {
+ case LONGOPT_NUM_CAP_COMMENT: /* capture comment */
+ if (capture_opts->capture_comment) {
+ cmdarg_err("--capture-comment can be set only once per file");
+ return 1;
+ }
+ capture_opts->capture_comment = g_strdup(optarg_str_p);
+ break;
case 'a': /* autostop criteria */
if (set_autostop_criterion(capture_opts, optarg_str_p) == FALSE) {
cmdarg_err("Invalid or unknown -a flag \"%s\"", optarg_str_p);