Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 617 Bytes

read-filter-expression-from-file.md

File metadata and controls

23 lines (16 loc) · 617 Bytes

Read filter expression from file

The filter expression can be read from file. E.g.:

# cat filter
port 80

"-F file" option can be used to read filter from file instead of command line:

# tcpdump -F filter
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp0s3, link-type EN10MB (Ethernet), capture size 262144 bytes
......

The code is here:

......
if (infile)
	cmdbuf = read_infile(infile);
else
	cmdbuf = copy_argv(&argv[optind]);
......