Blame lib/Net/DNS/RR/MINFO.pm

Packit Service f6e53a
package Net::DNS::RR::MINFO;
Packit Service f6e53a
Packit Service f6e53a
#
Packit Service f6e53a
# $Id: MINFO.pm 1597 2017-09-22 08:04:02Z willem $
Packit Service f6e53a
#
Packit Service f6e53a
our $VERSION = (qw$LastChangedRevision: 1597 $)[1];
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
use strict;
Packit Service f6e53a
use warnings;
Packit Service f6e53a
use base qw(Net::DNS::RR);
Packit Service f6e53a
Packit Service f6e53a
=head1 NAME
Packit Service f6e53a
Packit Service f6e53a
Net::DNS::RR::MINFO - DNS MINFO resource record
Packit Service f6e53a
Packit Service f6e53a
=cut
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
use integer;
Packit Service f6e53a
Packit Service f6e53a
use Net::DNS::Mailbox;
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
sub _decode_rdata {			## decode rdata from wire-format octet string
Packit Service f6e53a
	my $self = shift;
Packit Service f6e53a
	my ( $data, $offset, @opaque ) = @_;
Packit Service f6e53a
Packit Service f6e53a
	( $self->{rmailbx}, $offset ) = decode Net::DNS::Mailbox1035(@_);
Packit Service f6e53a
	( $self->{emailbx}, $offset ) = decode Net::DNS::Mailbox1035( $data, $offset, @opaque );
Packit Service f6e53a
}
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
sub _encode_rdata {			## encode rdata as wire-format octet string
Packit Service f6e53a
	my $self = shift;
Packit Service f6e53a
	my ( $offset, @opaque ) = @_;
Packit Service f6e53a
Packit Service f6e53a
	my $rdata = $self->{rmailbx}->encode(@_);
Packit Service f6e53a
	$rdata .= $self->{emailbx}->encode( $offset + length $rdata, @opaque );
Packit Service f6e53a
}
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
sub _format_rdata {			## format rdata portion of RR string.
Packit Service f6e53a
	my $self = shift;
Packit Service f6e53a
Packit Service f6e53a
	my @rdata = ( $self->{rmailbx}->string, $self->{emailbx}->string );
Packit Service f6e53a
}
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
sub _parse_rdata {			## populate RR from rdata in argument list
Packit Service f6e53a
	my $self = shift;
Packit Service f6e53a
Packit Service f6e53a
	$self->rmailbx(shift);
Packit Service f6e53a
	$self->emailbx(shift);
Packit Service f6e53a
}
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
sub rmailbx {
Packit Service f6e53a
	my $self = shift;
Packit Service f6e53a
Packit Service f6e53a
	$self->{rmailbx} = new Net::DNS::Mailbox1035(shift) if scalar @_;
Packit Service f6e53a
	$self->{rmailbx}->address if $self->{rmailbx};
Packit Service f6e53a
}
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
sub emailbx {
Packit Service f6e53a
	my $self = shift;
Packit Service f6e53a
Packit Service f6e53a
	$self->{emailbx} = new Net::DNS::Mailbox1035(shift) if scalar @_;
Packit Service f6e53a
	$self->{emailbx}->address if $self->{emailbx};
Packit Service f6e53a
}
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
1;
Packit Service f6e53a
__END__
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
=head1 SYNOPSIS
Packit Service f6e53a
Packit Service f6e53a
    use Net::DNS;
Packit Service f6e53a
    $rr = new Net::DNS::RR('name MINFO rmailbx emailbx');
Packit Service f6e53a
Packit Service f6e53a
=head1 DESCRIPTION
Packit Service f6e53a
Packit Service f6e53a
Class for DNS Mailbox Information (MINFO) resource records.
Packit Service f6e53a
Packit Service f6e53a
=head1 METHODS
Packit Service f6e53a
Packit Service f6e53a
The available methods are those inherited from the base class augmented
Packit Service f6e53a
by the type-specific methods defined in this package.
Packit Service f6e53a
Packit Service f6e53a
Use of undocumented package features or direct access to internal data
Packit Service f6e53a
structures is discouraged and could result in program termination or
Packit Service f6e53a
other unpredictable behaviour.
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
=head2 rmailbx
Packit Service f6e53a
Packit Service f6e53a
    $rmailbx = $rr->rmailbx;
Packit Service f6e53a
    $rr->rmailbx( $rmailbx );
Packit Service f6e53a
Packit Service f6e53a
A domain name  which specifies a mailbox which is
Packit Service f6e53a
responsible for the mailing list or mailbox.  If this
Packit Service f6e53a
domain name names the root, the owner of the MINFO RR is
Packit Service f6e53a
responsible for itself. Note that many existing mailing
Packit Service f6e53a
lists use a mailbox X-request to identify the maintainer
Packit Service f6e53a
of mailing list X, e.g., Msgroup-request for Msgroup.
Packit Service f6e53a
This field provides a more general mechanism.
Packit Service f6e53a
Packit Service f6e53a
=head2 emailbx
Packit Service f6e53a
Packit Service f6e53a
    $emailbx = $rr->emailbx;
Packit Service f6e53a
    $rr->emailbx( $emailbx );
Packit Service f6e53a
Packit Service f6e53a
A domain name  which specifies a mailbox which is to
Packit Service f6e53a
receive error messages related to the mailing list or
Packit Service f6e53a
mailbox specified by the owner of the MINFO RR (similar
Packit Service f6e53a
to the ERRORS-TO: field which has been proposed).
Packit Service f6e53a
If this domain name names the root, errors should be
Packit Service f6e53a
returned to the sender of the message.
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
=head1 COPYRIGHT
Packit Service f6e53a
Packit Service f6e53a
Copyright (c)1997 Michael Fuhr. 
Packit Service f6e53a
Packit Service f6e53a
All rights reserved.
Packit Service f6e53a
Packit Service f6e53a
Package template (c)2009,2012 O.M.Kolkman and R.W.Franks.
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
=head1 LICENSE
Packit Service f6e53a
Packit Service f6e53a
Permission to use, copy, modify, and distribute this software and its
Packit Service f6e53a
documentation for any purpose and without fee is hereby granted, provided
Packit Service f6e53a
that the above copyright notice appear in all copies and that both that
Packit Service f6e53a
copyright notice and this permission notice appear in supporting
Packit Service f6e53a
documentation, and that the name of the author not be used in advertising
Packit Service f6e53a
or publicity pertaining to distribution of the software without specific
Packit Service f6e53a
prior written permission.
Packit Service f6e53a
Packit Service f6e53a
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service f6e53a
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service f6e53a
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
Packit Service f6e53a
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Packit Service f6e53a
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
Packit Service f6e53a
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
Packit Service f6e53a
DEALINGS IN THE SOFTWARE.
Packit Service f6e53a
Packit Service f6e53a
Packit Service f6e53a
=head1 SEE ALSO
Packit Service f6e53a
Packit Service f6e53a
L<perl>, L<Net::DNS>, L<Net::DNS::RR>, RFC1035 Section 3.3.7
Packit Service f6e53a
Packit Service f6e53a
=cut