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 / X25.pm < prev    next >
Encoding:
Perl POD Document  |  2004-01-04  |  1.7 KB  |  95 lines

  1. package Net::DNS::RR::X25;
  2. #
  3. # $Id: X25.pm,v 2.101 2004/01/04 04:31:11 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.         my ($len) = unpack("\@$offset C", $$data);
  18.         ++$offset;
  19.         $self->{"psdn"} = substr($$data, $offset, $len);
  20.         $offset += $len;
  21.     }
  22.  
  23.     return bless $self, $class;
  24. }
  25.  
  26. sub new_from_string {
  27.     my ($class, $self, $string) = @_;
  28.  
  29.     if ($string && $string =~ /^\s*["']?(.*?)["']?\s*$/) {
  30.         $self->{"psdn"} = $1;
  31.     }
  32.  
  33.     return bless $self, $class;
  34. }
  35.  
  36. sub rdatastr {
  37.     my $self = shift;
  38.  
  39.     return exists $self->{"psdn"}
  40.            ? qq("$self->{psdn}")
  41.            : '';
  42. }
  43.  
  44. sub rr_rdata {
  45.     my $self = shift;
  46.     my $rdata = "";
  47.  
  48.     if (exists $self->{"psdn"}) {
  49.         $rdata .= pack("C", length $self->{"psdn"});
  50.         $rdata .= $self->{"psdn"};
  51.     }
  52.  
  53.     return $rdata;
  54. }
  55.  
  56. 1;
  57. __END__
  58.  
  59. =head1 NAME
  60.  
  61. Net::DNS::RR::X25 - DNS X25 resource record
  62.  
  63. =head1 SYNOPSIS
  64.  
  65. C<use Net::DNS::RR>;
  66.  
  67. =head1 DESCRIPTION
  68.  
  69. Class for DNS X25 resource records.
  70.  
  71. =head1 METHODS
  72.  
  73. =head2 psdn
  74.  
  75.     print "psdn = ", $rr->psdn, "\n";
  76.  
  77. Returns the PSDN address.
  78.  
  79. =head1 COPYRIGHT
  80.  
  81. Copyright (c) 1997-2002 Michael Fuhr. 
  82.  
  83. Portions Copyright (c) 2002-2003 Chris Reinhardt.
  84.  
  85. All rights reserved.  This program is free software; you may redistribute
  86. it and/or modify it under the same terms as Perl itself.
  87.  
  88. =head1 SEE ALSO
  89.  
  90. L<perl(1)>, L<Net::DNS>, L<Net::DNS::Resolver>, L<Net::DNS::Packet>,
  91. L<Net::DNS::Header>, L<Net::DNS::Question>, L<Net::DNS::RR>,
  92. RFC 1183 Section 3.1
  93.  
  94. =cut
  95.