Net::DNS::RR::X25 - DNS X25 resource record


Net-DNS documentation Contained in the Net-DNS distribution.

Index


Code Index:

NAME

Top

Net::DNS::RR::X25 - DNS X25 resource record

SYNOPSIS

Top

use Net::DNS::RR;

DESCRIPTION

Top

Class for DNS X25 resource records.

METHODS

Top

psdn

    print "psdn = ", $rr->psdn, "\n";

Returns the PSDN address.

COPYRIGHT

Top

SEE ALSO

Top

perl(1), Net::DNS, Net::DNS::Resolver, Net::DNS::Packet, Net::DNS::Header, Net::DNS::Question, Net::DNS::RR, RFC 1183 Section 3.1


Net-DNS documentation Contained in the Net-DNS distribution.

package Net::DNS::RR::X25;
#
# $Id: X25.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 ($len) = unpack("\@$offset C", $$data);
		++$offset;
		$self->{"psdn"} = substr($$data, $offset, $len);
		$offset += $len;
	}

	return bless $self, $class;
}

sub new_from_string {
	my ($class, $self, $string) = @_;

	if ($string && $string =~ /^\s*["']?(.*?)["']?\s*$/) {
		$self->{"psdn"} = $1;
	}

	return bless $self, $class;
}

sub rdatastr {
	my $self = shift;

	return exists $self->{"psdn"}
	       ? qq("$self->{psdn}")
	       : '';
}

sub rr_rdata {
	my $self = shift;
	my $rdata = "";

	if (exists $self->{"psdn"}) {
		$rdata .= pack("C", length $self->{"psdn"});
		$rdata .= $self->{"psdn"};
	}

	return $rdata;
}

1;
__END__