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

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