CVSROOT:        /cvs
Module name:    src
Changes by:     d...@cvs.openbsd.org    2020/08/02 21:40:02

Modified files:
        lib/libpcap    : gencode.c gencode.h grammar.y pcap-filter.5 
                         scanner.l 

Log message:
add "sample NUM" so you can ask to capture 1/NUM packets from a filter.

the use of the sample keyword matches similar config in other
products.

NUM can be a number between 2 and 1048576, and is used to divide
0x100000000 into a threshold that is then compared against a randomly
generated number produced by a load of BPF_RND.

having sampling as part of the grammar means you can write things
like "icmp or sample 128". this lets you capture all icmp traffic
and a sample of the rest of the traffic.

ok jmatthew@ kn@ tb@

Reply via email to