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 / MB.pm < prev    next >
Encoding:
Perl POD Document  |  2004-01-04  |  1.8 KB  |  99 lines

  1. package Net::DNS::RR::MB;
  2. #
  3. # $Id: MB.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->{"madname"}) = 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->{"madname"} = $string;
  29.     }
  30.  
  31.     return bless $self, $class;
  32. }
  33.  
  34. sub rdatastr {
  35.     my $self = shift;
  36.  
  37.     return $self->{"madname"} ? "$self->{madname}." : '';
  38. }
  39.  
  40. sub rr_rdata {
  41.     my ($self, $packet, $offset) = @_;
  42.     my $rdata = "";
  43.  
  44.     if (exists $self->{"madname"}) {
  45.         $rdata .= $packet->dn_comp($self->{"madname"}, $offset);
  46.     }
  47.  
  48.     return $rdata;
  49. }
  50.  
  51. sub _canonicalRdata {
  52.     my $self=shift;
  53.     my $rdata = "";
  54.     if (exists $self->{"madname"}) {
  55.         $rdata .= $self->_name2wire($self->{"madname"});
  56.     }
  57.     return $rdata;
  58. }
  59.  
  60.  
  61. 1;
  62. __END__
  63.  
  64. =head1 NAME
  65.  
  66. Net::DNS::RR::MB - DNS MB resource record
  67.  
  68. =head1 SYNOPSIS
  69.  
  70. C<use Net::DNS::RR>;
  71.  
  72. =head1 DESCRIPTION
  73.  
  74. Class for DNS Mailbox (MB) resource records.
  75.  
  76. =head1 METHODS
  77.  
  78. =head2 madname
  79.  
  80.     print "madname = ", $rr->madname, "\n";
  81.  
  82. Returns the domain name of the host which has the specified mailbox.
  83.  
  84. =head1 COPYRIGHT
  85.  
  86. Copyright (c) 1997-2002 Michael Fuhr. 
  87.  
  88. Portions Copyright (c) 2002-2003 Chris Reinhardt.
  89.  
  90. All rights reserved.  This program is free software; you may redistribute
  91. it and/or modify it under the same terms as Perl itself.
  92. =head1 SEE ALSO
  93.  
  94. L<perl(1)>, L<Net::DNS>, L<Net::DNS::Resolver>, L<Net::DNS::Packet>,
  95. L<Net::DNS::Header>, L<Net::DNS::Question>, L<Net::DNS::RR>,
  96. RFC 1035 Section 3.3.3
  97.  
  98. =cut
  99.