~ubuntu-branches/ubuntu/trusty/libnet-dns-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/Net/DNS/RR/MX.pm

  • Committer: Bazaar Package Importer
  • Author(s): Florian Hinzmann
  • Date: 2006-03-31 18:51:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060331185136-gpxyhfnnnt9f9b1n
Tags: 0.57-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package Net::DNS::RR::MX;
2
2
#
3
 
# $Id: MX.pm 388 2005-06-22 10:06:05Z olaf $
 
3
# $Id: MX.pm 564 2006-02-20 09:34:26Z olaf $
4
4
#
5
5
use strict;
6
6
BEGIN { 
9
9
use vars qw(@ISA $VERSION);
10
10
 
11
11
@ISA     = qw(Net::DNS::RR);
12
 
$VERSION = (qw$LastChangedRevision: 388 $)[1];
 
12
$VERSION = (qw$LastChangedRevision: 564 $)[1];
 
13
 
 
14
 
 
15
# Highest preference sorted first.
 
16
__PACKAGE__->set_rrsort_func("preference",
 
17
                               sub {
 
18
                                   my ($a,$b)=($Net::DNS::a,$Net::DNS::b);
 
19
                                   $a->{'preference'} <=> $b->{'preference'}
 
20
}
 
21
);
 
22
 
 
23
 
 
24
__PACKAGE__->set_rrsort_func("default_sort",
 
25
                               __PACKAGE__->get_rrsort_func("preference")
 
26
 
 
27
    );
 
28
 
 
29
 
13
30
 
14
31
sub new {
15
32
        my ($class, $self, $data, $offset) = @_;
16
33
 
17
34
        if ($self->{"rdlength"} > 0) {
18
35
                ($self->{"preference"}) = unpack("\@$offset n", $$data);
19
 
                
20
36
                $offset += Net::DNS::INT16SZ();
21
37
                
22
38
                ($self->{"exchange"}) = Net::DNS::Packet::dn_expand($data, $offset);
105
121
Copyright (c) 1997-2002 Michael Fuhr. 
106
122
 
107
123
Portions Copyright (c) 2002-2004 Chris Reinhardt.
 
124
Portions Copyright (c) 2005 Olaf Kolkman NLnet Labs.
108
125
 
109
126
All rights reserved.  This program is free software; you may redistribute
110
127
it and/or modify it under the same terms as Perl itself.