Branch Coverage

blib/lib/Metabrik/Network/Stream.pm
Criterion Covered Total %
branch 0 96 0.0


line true false branch
59 0 0 unless $self->brik_help_run_undef_arg('from_pcap', $file)
60 0 0 unless $self->brik_help_run_file_not_found('from_pcap', $file)
64 0 0 unless my $fp = 'Metabrik::File::Pcap'->new_from_brik_init($self)
65 0 0 unless $fp->open($file, 'read', $filter)
74 0 0 if @$h == 0
76 0 0 unless my $simple = $fp->from_read($this)
80 0 0 if (defined $network and defined $transport)
94 0 0 unless defined $src_ip
96 0 0 if ($this_src_ip eq $src_ip || $this_src_ip eq $dst_ip and $this_src_port eq $src_port || $this_src_port eq $dst_port)
108 0 0 if (defined $transport and length $transport->payload and defined $network)
125 0 0 unless $self->brik_help_run_undef_arg('to_pcap', $file)
126 0 0 unless $self->brik_help_run_undef_arg('to_pcap', $stream)
127 0 0 unless $self->brik_help_run_invalid_arg('to_pcap', $stream, 'ARRAY')
128 0 0 unless $self->brik_help_run_empty_array_arg('to_pcap', $stream)
131 0 0 if (ref $first ne 'Net::Frame::Simple')
135 0 0 unless my $fp = 'Metabrik::File::Pcap'->new_from_brik_init($self)
136 0 0 unless $fp->open($file, 'write', $first->firstLayer)
137 0 0 unless my $frames = $fp->to_read($stream)
138 0 0 unless $fp->write($frames)
148 0 0 unless $self->brik_help_run_undef_arg('list_source_ip_addresses', $stream)
149 0 0 unless $self->brik_help_run_invalid_arg('list_source_ip_addresses', $stream, 'ARRAY')
150 0 0 unless $self->brik_help_run_empty_array_arg('list_source_ip_addresses', $stream)
152 0 0 if (ref $stream->[0] ne 'Net::Frame::Simple')
159 0 0 if (defined $network)
171 0 0 unless $self->brik_help_run_undef_arg('list_destination_ip_addresses', $stream)
172 0 0 unless $self->brik_help_run_invalid_arg('list_destination_ip_addresses', $stream, 'ARRAY')
173 0 0 unless $self->brik_help_run_empty_array_arg('list_destination_ip_addresses', $stream)
175 0 0 if (ref $stream->[0] ne 'Net::Frame::Simple')
182 0 0 if (defined $network)
194 0 0 unless $self->brik_help_run_undef_arg('list_tcp_streams', $frames)
195 0 0 unless $self->brik_help_run_invalid_arg('list_tcp_streams', $frames, 'ARRAY')
196 0 0 unless $self->brik_help_run_empty_array_arg('list_tcp_streams', $frames)
198 0 0 if (ref $frames->[0] ne 'Net::Frame::Simple')
214 0 0 if (exists $streams{$id1}) { }
229 0 0 unless $self->brik_help_run_undef_arg('save_stream_payload', $frames)
230 0 0 unless $self->brik_help_run_invalid_arg('save_stream_payload', $frames, 'ARRAY')
231 0 0 unless $self->brik_help_run_empty_array_arg('save_stream_payload', $frames)
233 0 0 if (ref $frames->[0] ne 'Net::Frame::Simple')
240 0 0 unless my $payload = $transport->payload
241 0 0 if (length $payload)
253 0 0 unless $self->brik_help_run_undef_arg('get_payloads_from_pcap', $file)
254 0 0 unless $self->brik_help_run_file_not_found('get_payloads_from_pcap', $file)
258 0 0 unless my $fp = 'Metabrik::File::Pcap'->new_from_brik_init($self)
259 0 0 unless $fp->open($file, 'read', $filter)
264 0 0 if @$h == 0
266 0 0 unless my $simple = $fp->from_read($this)
270 0 0 if (defined $network and defined $transport)
271 0 0 if (defined $transport and length $transport->payload)