ConntrackFormat.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 18 / 18 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Utils.pm ↑ Summary
1 package Net::Netfilter::NetFlow::ConntrackFormat;
2 {
3 2 $Net::Netfilter::NetFlow::ConntrackFormat::VERSION = '1.113260';
4 }
5  
6 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 our @EXPORT = qw(
11 %ct_new_key
12 %ct_destroy_key
13 %ct_mask_fields
14 );
15  
16 # TODO document and make user configurable
17  
18 # 1:icmp - src,src,dst,id
19 # 6:tcp - src,sport,src,sport,dst,dport
20 # 17:udp - src,sport,src,sport,dst,dport
21 # first src is private, second is public (post SNAT)
22  
23 2 our %ct_new_key = (
24 1 => [4,11,5,8],
25 6 => [5,7,11,13,6,8],
26 17 => [4,6,10,12,5,7],
27 );
28  
29 2 our %ct_destroy_key = (
30 1 => [3,11,4,7],
31 6 => [3,5,10,12,4,6],
32 17 => [3,5,10,12,4,6],
33 );
34  
35 # dpkts, doctets, srcaddr, dstaddr, srcport, dstport
36 2 our %ct_mask_fields = (
37 1 => {
38 # field 17 does not exist
39 private_src => [8,9,3,4,17,17],
40 public_src => [8,9,11,10,17,17],
41 dst => [15,16,10,11,17,17],
42 },
43 6 => {
44 private_src => [7,8,3,4,5,6],
45 public_src => [7,8,10,9,12,11],
46 dst => [13,14,9,10,11,12],
47 },
48 17 => {
49 private_src => [7,8,3,4,5,6],
50 public_src => [7,8,10,9,12,11],
51 dst => [13,14,9,10,11,12],
52 },
53 );
54  
55 __END__
« Utils.pm ↑ Summary