?¡ëPNG
IHDR ? f ??C1 sRGB ??¨¦ gAMA ¡À?¨¹a pHYs ? ??o¡§d GIDATx^¨ª¨¹L¡±¡Âe¡ÂY?a?("Bh?_¨°???¡é¡ì?q5k?*:t0A-o??£¤]VkJ¡éM??f?¡À8\k2¨ªll¡ê1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
package Net::DNS::RR::NSAP;
#
# $Id: NSAP.pm 388 2005-06-22 10:06:05Z olaf $
#
use strict;
BEGIN {
eval { require bytes; }
}
use vars qw(@ISA $VERSION);
@ISA = qw(Net::DNS::RR);
$VERSION = (qw$LastChangedRevision: 388 $)[1];
sub new {
my ($class, $self, $data, $offset) = @_;
if ($self->{"rdlength"} > 0) {
my $afi = unpack("\@$offset C", $$data);
$self->{"afi"} = sprintf("%02x", $afi);
++$offset;
if ($self->{"afi"} eq "47") {
my @idi = unpack("\@$offset C2", $$data);
$offset += 2;
my $dfi = unpack("\@$offset C", $$data);
$offset += 1;
my @aa = unpack("\@$offset C3", $$data);
$offset += 3;
my @rsvd = unpack("\@$offset C2", $$data);
$offset += 2;
my @rd = unpack("\@$offset C2", $$data);
$offset += 2;
my @area = unpack("\@$offset C2", $$data);
$offset += 2;
my @id = unpack("\@$offset C6", $$data);
$offset += 6;
my $sel = unpack("\@$offset C", $$data);
$offset += 1;
$self->{"idi"} = sprintf("%02x" x 2, @idi);
$self->{"dfi"} = sprintf("%02x" x 1, $dfi);
$self->{"aa"} = sprintf("%02x" x 3, @aa);
$self->{"rsvd"} = sprintf("%02x" x 2, @rsvd);
$self->{"rd"} = sprintf("%02x" x 2, @rd);
$self->{"area"} = sprintf("%02x" x 2, @area);
$self->{"id"} = sprintf("%02x" x 6, @id);
$self->{"sel"} = sprintf("%02x" x 1, $sel);
} else {
# What to do for unsupported versions?
}
}
return bless $self, $class;
}
sub new_from_string {
my ($class, $self, $string) = @_;
if ($string) {
$string =~ s/\.//g; # remove all dots.
$string =~ s/^0x//; # remove leading 0x
if ($string =~ /^[a-zA-Z0-9]{40}$/) {
@{ $self }{ qw(afi idi dfi aa rsvd rd area id sel) } =
unpack("A2A4A2A6A4A4A4A12A2", $string);
}
}
return bless $self, $class;
}
sub idp {
my $self = shift;
return join('', $self->{"afi"},
$self->{"idi"});
}
sub dsp {
my $self = shift;
return join('',
$self->{"dfi"},
$self->{"aa"},
$self->rsvd,
$self->{"rd"},
$self->{"area"},
$self->{"id"},
$self->{"sel"});
}
sub rsvd {
my $self = shift;
return exists $self->{"rsvd"} ? $self->{"rsvd"} : "0000";
}
sub rdatastr {
my $self = shift;
my $rdatastr;
if (exists $self->{"afi"}) {
if ($self->{"afi"} eq "47") {
$rdatastr = join('', $self->idp, $self->dsp);
} else {
$rdatastr = "; AFI $self->{'afi'} not supported";
}
} else {
$rdatastr = '';
}
return $rdatastr;
}
sub rr_rdata {
my $self = shift;
my $rdata = "";
if (exists $self->{"afi"}) {
$rdata .= pack("C", hex($self->{"afi"}));
if ($self->{"afi"} eq "47") {
$rdata .= str2bcd($self->{"idi"}, 2);
$rdata .= str2bcd($self->{"dfi"}, 1);
$rdata .= str2bcd($self->{"aa"}, 3);
$rdata .= str2bcd(0, 2); # rsvd
$rdata .= str2bcd($self->{"rd"}, 2);
$rdata .= str2bcd($self->{"area"}, 2);
$rdata .= str2bcd($self->{"id"}, 6);
$rdata .= str2bcd($self->{"sel"}, 1);
}
# Checks for other versions would go here.
}
return $rdata;
}
#------------------------------------------------------------------------------
# Usage: str2bcd(STRING, NUM_BYTES)
#
# Takes a string representing a hex number of arbitrary length and
# returns an equivalent BCD string of NUM_BYTES length (with
# NUM_BYTES * 2 digits), adding leading zeros if necessary.
#------------------------------------------------------------------------------
# This can't be the best way....
sub str2bcd {
my ($string, $bytes) = @_;
my $retval = "";
my $digits = $bytes * 2;
$string = sprintf("%${digits}s", $string);
$string =~ tr/ /0/;
my $i;
for ($i = 0; $i < $bytes; ++$i) {
my $bcd = substr($string, $i*2, 2);
$retval .= pack("C", hex $bcd);
}
return $retval;
}
1;
__END__
=head1 NAME
Net::DNS::RR::NSAP - DNS NSAP resource record
=head1 SYNOPSIS
C