:MD5 qw(md5_hex);
use File::Spec;
use IPC::Cmd qw(run);
use File::Copy "cp";
use Sys::Syslog;
use JSON;
use Time::Piece;
=head1 NAME
Virani - PCAP retrieval for a FPC setup writing to PCAP files.
=
e path to the file.
my $cache_file=$virani->get_cache_file(%opts);
if (! -f $cache_file.'json'){
echo "Cache file metadata does not exist, so either get_pcap_local died or it has not
cache_file
&& -f $cache_file . '.json' )
{
$return_cache = 1;
} elsif ( !defined( $opts{file} ) && !$opts{no_cache} && -f $cache_file && -f $cache_file . '.json' ) {
$return_cache = 1;
}
if
ss $self;
return $self;
}
=head2 fetch
Reaches out via HTTP or HTTPS and fetches the PCAP and JSON metadata.
- start :: A L<Time::Piece> object of when to start looking.
- Default ::
ile :: The file to output to. The metadata writen to a file of the same name
with '.json' appended.
- Default :: out.pcap
- type :: 'tcpdump', 'bpf2tshark', or 'tshark', dep
start
end
filter
IF the command success the raw unparsed JSON of the metadata is returned.
my $raw_metadata_json=$virani_client->(start=>$start, end=>$end, filter=>$filter);
=cut
s