Net::DNS::RR::MB - DNS MB resource record


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

Index


Code Index:

NAME

Top

Net::DNS::RR::MB - DNS MB resource record

SYNOPSIS

Top

use Net::DNS::RR;

DESCRIPTION

Top

Class for DNS Mailbox (MB) resource records.

METHODS

Top

madname

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

Returns the domain name of the host which has the specified mailbox.

COPYRIGHT

Top


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

package Net::DNS::RR::MB;
#
# $Id: MB.pm 718 2008-02-26 21:49:20Z olaf $
#
use strict;
BEGIN { 
    eval { require bytes; }
} 
use vars qw(@ISA $VERSION);

@ISA     = qw(Net::DNS::RR);
$VERSION = (qw$LastChangedRevision: 718 $)[1];

sub new {
	my ($class, $self, $data, $offset) = @_;

	if ($self->{"rdlength"} > 0) {
		($self->{"madname"}) = Net::DNS::Packet::dn_expand($data, $offset);
	}

	return bless $self, $class;
}

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

	if ($string) {
		$self->{"madname"} = Net::DNS::stripdot($string);
	}

	return bless $self, $class;
}

sub rdatastr {
	my $self = shift;

	return $self->{"madname"} ? "$self->{madname}." : '';
}

sub rr_rdata {
	my ($self, $packet, $offset) = @_;
	my $rdata = "";

	if (exists $self->{"madname"}) {
		$rdata .= $packet->dn_comp($self->{"madname"}, $offset);
	}

	return $rdata;
}


sub _normalize_dnames {
	my $self=shift;
	$self->_normalize_ownername();
	$self->{"madname"}=Net::DNS::stripdot($self->{"madname"}) if defined $self->{"madname"};
}



sub _canonicalRdata {
    my $self=shift;
    my $rdata = "";
    if (exists $self->{"madname"}) {
		$rdata .= $self->_name2wire(lc($self->{"madname"}));
	}
	return $rdata;
}


1;
__END__