File Coverage

blib/lib/Protocol/SOCKS/Constants.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 18 100.0


line stmt bran cond sub pod time code
1             package Protocol::SOCKS::Constants;
2             $Protocol::SOCKS::Constants::VERSION = '0.003';
3 3     3   18 use strict;
  3         6  
  3         115  
4 3     3   19 use warnings;
  3         6  
  3         135  
5              
6 3     3   701 use parent qw(Exporter);
  3         272  
  3         37  
7              
8             my %const;
9             BEGIN {
10 3     3   319 %const = (
11             ATYPE_IPV4 => 1,
12             ATYPE_IPV6 => 4,
13             ATYPE_FQDN => 3,
14              
15             AUTH_NONE => 0x00,
16             AUTH_GSSAPI => 0x01,
17             AUTH_USERNAME => 0x02,
18             AUTH_FAIL => 0xFF,
19              
20             CMD_CONNECT => 0x01,
21             CMD_BIND => 0x02,
22             CMD_UDP => 0x03,
23             );
24             }
25 3     3   29 use constant +{ %const };
  3         5  
  3         783  
26              
27             our @EXPORT_OK = sort keys %const;
28             our %EXPORT_TAGS = (
29             all => [ sort keys %const ],
30              
31             auth => [ sort grep /^AUTH_/, keys %const ],
32             atype => [ sort grep /^ATYPE_/, keys %const ],
33             cmd => [ sort grep /^CMD_/, keys %const ],
34             );
35              
36             1;
37