/usr/lib/x86_64-linux-gnu/perl5/5.20/auto/NetAddr/IP/re6.al is in libnetaddr-ip-perl 4.075+dfsg-1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | # NOTE: Derived from blib/lib/NetAddr/IP.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package NetAddr::IP;
#line 1464 "blib/lib/NetAddr/IP.pm (autosplit into blib/lib/auto/NetAddr/IP/re6.al)"
sub re6($) {
my @net = split('',sprintf("%04X%04X%04X%04X%04X%04X%04X%04X",unpack('n8',$_[0]->network->{addr})));
my @brd = split('',sprintf("%04X%04X%04X%04X%04X%04X%04X%04X",unpack('n8',$_[0]->broadcast->{addr})));
my @dig;
foreach(0..$#net) {
my $n = $net[$_];
my $b = $brd[$_];
my $m;
if ($n.'' eq $b.'') {
if ($n =~ /\d/) {
push @dig, $n;
} else {
push @dig, '['.(lc $n).$n.']';
}
} else {
my $n = $net[$_];
my $b = $brd[$_];
if ($n.'' eq 0 && $b =~ /F/) {
push @dig, 'x';
}
elsif ($n =~ /\d/ && $b =~ /\d/) {
push @dig, '['.$n.'-'.$b.']';
}
elsif ($n =~ /[A-F]/ && $b =~ /[A-F]/) {
$n .= '-'.$b;
push @dig, '['.(lc $n).$n.']';
}
elsif ($n =~ /\d/ && $b =~ /[A-F]/) {
$m = ($n == 9) ? 9 : $n .'-9';
if ($b =~ /A/) {
$m .= 'aA';
} else {
$b = 'A-'. $b;
$m .= (lc $b). $b;
}
push @dig, '['.$m.']';
}
elsif ($n =~ /[A-F]/ && $b =~ /\d/) {
if ($n =~ /A/) {
$m = 'aA';
} else {
$n .= '-F';
$m = (lc $n).$n;
}
if ($b == 9) {
$m .= 9;
} else {
$m .= $b .'-9';
}
push @dig, '['.$m.']';
}
}
}
my @grp;
do {
my $grp = join('',splice(@dig,0,4));
if ($grp =~ /^(0+)/) {
my $l = length($1);
if ($l == 4) {
$grp = '0{1,4}';
} else {
$grp =~ s/^${1}/0\{0,$l\}/;
}
}
if ($grp =~ /(x+)$/) {
my $l = length($1);
if ($l == 4) {
$grp = '[0-9a-fA-F]{1,4}';
} else {
$grp =~ s/x+/\[0\-9a\-fA\-F\]\{$l\}/;
}
}
push @grp, $grp;
} while @dig > 0;
return '('. join(':',@grp) .')';
}
# end of NetAddr::IP::re6
1;
|