home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / MR.pm < prev    next >
Encoding:
Perl POD Document  |  2004-01-04  |  1.8 KB  |  101 lines

  1. package Net::DNS::RR::MR;
  2. #
  3. # $Id: MR.pm,v 2.101 2004/01/04 04:31:10 ctriv Exp $
  4. #
  5. use strict;
  6. use vars qw(@ISA $VERSION);
  7.  
  8. use Net::DNS::Packet;
  9.  
  10. @ISA     = qw(Net::DNS::RR);
  11. $VERSION = (qw$Revision: 2.101 $)[1];
  12.  
  13. sub new {
  14.     my ($class, $self, $data, $offset) = @_;
  15.  
  16.     if ($self->{"rdlength"} > 0) {
  17.         ($self->{"newname"}) = Net::DNS::Packet::dn_expand($data, $offset);
  18.     }
  19.  
  20.     return bless $self, $class;
  21. }
  22.  
  23. sub new_from_string {
  24.     my ($class, $self, $string) = @_;
  25.  
  26.     if ($string) {
  27.         $string =~ s/\.+$//;
  28.         $self->{"newname"} = $string;
  29.     }
  30.  
  31.     return bless $self, $class;
  32. }
  33.  
  34. sub rdatastr {
  35.     my $self = shift;
  36.  
  37.     return $self->{"newname"} ? "$self->{newname}." : '';
  38. }
  39.  
  40. sub rr_rdata {
  41.     my ($self, $packet, $offset) = @_;
  42.     my $rdata = "";
  43.  
  44.     if (exists $self->{"newname"}) {
  45.         $rdata .= $packet->dn_comp($self->{"newname"}, $offset);
  46.     }
  47.  
  48.     return $rdata;
  49. }
  50.  
  51. sub _canonicalRdata {
  52.     my $self=shift;
  53.     my $rdata = "";
  54.     if (exists $self->{"newname"}) {
  55.         $rdata .= $self->_name2wire($self->{"newname"});
  56.     }
  57.     return $rdata;
  58. }
  59.  
  60.  
  61.  
  62. 1;
  63. __END__
  64.  
  65. =head1 NAME
  66.  
  67. Net::DNS::RR::MR - DNS MR resource record
  68.  
  69. =head1 SYNOPSIS
  70.  
  71. C<use Net::DNS::RR>;
  72.  
  73. =head1 DESCRIPTION
  74.  
  75. Class for DNS Mail Rename (MR) resource records.
  76.  
  77. =head1 METHODS
  78.  
  79. =head2 newname
  80.  
  81.     print "newname = ", $rr->newname, "\n";
  82.  
  83. Returns the RR's new name field.
  84.  
  85. =head1 COPYRIGHT
  86.  
  87. Copyright (c) 1997-2002 Michael Fuhr. 
  88.  
  89. Portions Copyright (c) 2002-2003 Chris Reinhardt.
  90.  
  91. All rights reserved.  This program is free software; you may redistribute
  92. it and/or modify it under the same terms as Perl itself.
  93.  
  94. =head1 SEE ALSO
  95.  
  96. L<perl(1)>, L<Net::DNS>, L<Net::DNS::Resolver>, L<Net::DNS::Packet>,
  97. L<Net::DNS::Header>, L<Net::DNS::Question>, L<Net::DNS::RR>,
  98. RFC 1035 Section 3.3.8
  99.  
  100. =cut
  101.