File Coverage

blib/lib/Net/Analysis/Constants.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             package Net::Analysis::Constants;
2             # $Id: Constants.pm 131 2005-10-02 17:24:31Z abworrall $
3              
4             # {{{ Boilerplate
5              
6 3     3   70737 use 5.008000;
  3         13  
  3         213  
7             our $VERSION = '0.01';
8 3     3   19 use strict;
  3         5  
  3         214  
9 3     3   17 use warnings;
  3         4  
  3         700  
10              
11             require Exporter;
12              
13             our @ISA = qw(Exporter);
14              
15             our @TCPFLAG_CONSTS = (qw(FIN SYN RST PSH ACK URG));
16              
17             our @SESHSTATE_CONSTS = (qw(SESH_UNDEFINED
18             SESH_CONNECTING
19             SESH_ESTABLISHED
20             SESH_HALF_CLOSED
21             SESH_CLOSED
22             ));
23              
24             our @PKTCLASS_CONSTS = qw(PKT_NOCLASS
25             PKT_NONDATA
26             PKT_DATA
27             PKT_DUP_DATA
28             PKT_FUTURE_DATA
29             );
30              
31             our @EXPORT = qw();
32             our @EXPORT_OK = (@TCPFLAG_CONSTS, @SESHSTATE_CONSTS, @PKTCLASS_CONSTS);
33             our %EXPORT_TAGS = (all => [ @EXPORT, @EXPORT_OK ],
34             tcpseshstates => [ @SESHSTATE_CONSTS ],
35             tcpflags => [ @TCPFLAG_CONSTS ],
36             packetclasses => [ @PKTCLASS_CONSTS ],);
37              
38             # }}}
39              
40             # TCP Session states
41             use constant {
42 3         443 SESH_UNDEFINED => 'SESH_UNDEFINED',
43              
44             # The main states; sending SYNs, data or FINs. Or all done.
45             SESH_CONNECTING => 'SESH_CONNECTING',
46             SESH_ESTABLISHED => 'SESH_ESTABLISHED',
47             SESH_HALF_CLOSED => 'SESH_HALF_CLOSED',
48             SESH_CLOSED => 'SESH_CLOSED'
49 3     3   19 };
  3         5  
50              
51             # TCP packet flags
52             use constant {
53 3         314 FIN => 0x01,
54             SYN => 0x02,
55             RST => 0x04,
56             PSH => 0x08,
57             ACK => 0x10,
58             URG => 0x20,
59 3     3   15 };
  3         5  
60              
61              
62             # How we classify the packet (for reporting
63             use constant {
64 3         410 PKT_NOCLASS => 0, # Should be an error
65             PKT_NONDATA => 1, # Was a bare ACK, or part of setup/teardown
66             PKT_DATA => 2, # Was a juicy data packet
67             PKT_DUP_DATA => 3, # Was a resend of data we already have
68             PKT_FUTURE_DATA => 4, # Was something we weren't expecting
69 3     3   21 };
  3         5  
70              
71              
72             1;
73             __END__