aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorDavid Perry <boolean263@protonmail.com>2022-02-09 14:32:28 +0000
committerA Wireshark GitLab Utility <6629907-ws-gitlab-utility@users.noreply.gitlab.com>2022-02-09 14:32:28 +0000
commit1e0d117eb7ab1ce7f4ff8a4fd6dc2529634d7baa (patch)
treee7670b02e6c4d49e4f321864e730e0e48433b151 /tshark.c
parentf72787e86ff78790559fd5550e98865e225bfb68 (diff)
Specify directory for temporary captures
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tshark.c b/tshark.c
index b58fd26878..c892ef7a16 100644
--- a/tshark.c
+++ b/tshark.c
@@ -482,6 +482,8 @@ print_usage(FILE *output)
fprintf(output, " values\n");
fprintf(output, " --elastic-mapping-filter <protocols> If -G elastic-mapping is specified, put only the\n");
fprintf(output, " specified protocols within the mapping file\n");
+ fprintf(output, " --temp-dir <directory> write temporary files to this directory\n");
+ fprintf(output, " (default: %s)\n", g_get_tmp_dir());
fprintf(output, "\n");
ws_log_print_usage(output);
@@ -616,7 +618,13 @@ about_folders(void)
*/
/* temp */
- printf("%-21s\t%s\n", "Temp:", g_get_tmp_dir());
+ constpath = g_get_tmp_dir();
+#ifdef HAVE_LIBPCAP
+ /* global_capture_opts only exists in this case */
+ if (global_capture_opts.temp_dir)
+ constpath = global_capture_opts.temp_dir;
+#endif
+ printf("%-21s\t%s\n", "Temp:", constpath);
/* pers conf */
path = get_persconffile_path("", FALSE);
@@ -1130,6 +1138,7 @@ main(int argc, char *argv[])
case 'B': /* Buffer size */
#endif
case LONGOPT_COMPRESS_TYPE: /* compress type */
+ case LONGOPT_CAPTURE_TMPDIR: /* capture temp directory */
/* These are options only for packet capture. */
#ifdef HAVE_LIBPCAP
exit_status = capture_opts_add_opt(&global_capture_opts, opt, ws_optarg);