aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/DNS-LDNS/lib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/DNS-LDNS/lib')
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS.pm34
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm8
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm47
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm11
18 files changed, 64 insertions, 64 deletions
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS.pm b/contrib/DNS-LDNS/lib/DNS/LDNS.pm
index d2fe20e193b3..beeedbef9263 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS.pm
@@ -651,7 +651,7 @@ our @EXPORT = qw(
read_anchor_file
);
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
@@ -706,15 +706,6 @@ require DNS::LDNS::KeyList;
require DNS::LDNS::DNSSecDataChain;
require DNS::LDNS::DNSSecTrustTree;
-# Some default values used by the constructors
-our $DEFAULT_CLASS = &LDNS_RR_CLASS_IN;
-our $DEFAULT_TTL = 86400; # 1d
-our $DEFAULT_ORIGIN = new DNS::LDNS::RData(&LDNS_RDF_TYPE_DNAME, '.');
-our $DEFAULT_SOA_REFRESH = 86400; # 1d
-our $DEFAULT_SOA_RETRY = 3600; # 1h
-our $DEFAULT_SOA_EXPIRE = 604800; # 1w
-our $DEFAULT_SOA_MINIMUM = 10800; # 3h
-
# Autoload methods go after =cut, and are processed by the autosplit program.
1;
@@ -778,7 +769,7 @@ Represents a parsed zonefile (maps to the ldns_zone struct)
=item B<DNS::LDNS::RRList>
Represents a list of RRs. This class is also used to represent an
-RRSet all the dnames and types are equal, (maps to the the
+RRSet if all the dnames and types are equal, (maps to the the
ldns_rr_list struct)
=item B<DNS::LDNS::RR>
@@ -909,15 +900,13 @@ freed.
The purpose for writing this wrapper class has been to be able to
process zone file data with good time performance. Data checking and
-error handling is a bit sparse. Calling a method with wrong argument
-types will some times kill the application with an intelligible error
-message, in other cases it may provoke a segmentation fault. Using
-out-of-range data values, e.g. in array indexes, may also cause
-unexpected results.
+error handling is a bit sparse.
-Most constructors and all methods returning a status will update the
-static DNS::LDNS::last_status variable. Most methods do not return a
-status and will not reset this variable even though they succeeds.
+Most constructors will update the DNS::LDNS::last_status variable if
+they fail (return undef). Wrapper methods to ldns functions which would
+return a status will update the static DNS::LDNS::last_status variable.
+Most methods do not return a status and will not reset this variable
+even though they succeeds.
=head2 EXPORT
@@ -1286,10 +1275,9 @@ None by default.
=head1 BUGS
-This package is currently in a very early stage of development. There
-are probably some bugs. You may also expect that method names and
-behaviour could still change without much considerations to backward
-compatibility.
+This package is still in the beta stage of development. There no known bugs,
+although parts of the code has not yet been very well tested. Bugreports will
+be greatly appreciated.
=head1 SEE ALSO
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm
index 42074dc153c8..28bebe044c0a 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub rrset {
my $self = shift;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm
index bea6bb7c4931..0af91e2e4c32 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my $class = shift;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm
index fbd9bb735628..05471c7d1d6e 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
# Note: Since this class does not have a constructor, we can let its child
# objects be owned by the parent. This reduces the recursion depth on
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm
index b7b3dccf9543..78aa080c9c19 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
# Note: This class does not have a constructor. Thus, it can not be created
# as an individual object. The data structure of the node is owned
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm
index 1b9ca66e6102..cdd3ed846dd4 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub add_parent {
my ($self, $parent, $sig, $parent_status) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm
index da809a6ace01..d273a00d2247 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
@@ -31,9 +31,9 @@ sub new {
if ($file) {
$zone = _new_from_file($file,
- $args{origin} || $LDNS::DEFAULT_ORIGIN,
- $args{ttl} || $LDNS::DEFAULT_TTL,
- $args{class} || $LDNS::DEFAULT_CLASS,
+ $args{origin},
+ $args{ttl} || 0,
+ $args{class} || 0,
$status, $line_nr);
}
else {
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm
index 014b7bee21af..e0d51e0d1ccd 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm
@@ -3,7 +3,7 @@ package DNS::LDNS::GC;
use strict;
use warnings;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
my %ref_count;
my %owned_by;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm
index bbce173dd8bb..f2fbb2e3e0ac 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm
index c39e1c704e53..678225fd9a4c 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my $class = shift;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm
index f9875bf5abd0..c8d4ae2d4d9f 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm
index 31f617cddb1b..38adb385dfce 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
# Note: This class does not have a constructor. Thus, it can not be created
# as an individual object. The data structure of the object will always be
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm
index e86bfa8ddfa4..f64731a5b85c 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
# Note: Since this class does not have a constructor, we can let its child
# objects be owned by the parent. This reduces the recursion depth on
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm
index 76ef5ebac861..d495d3fbcf36 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, $type, $str) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm
index 91f34afb4028..70c919cd295a 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm
@@ -5,9 +5,8 @@ use strict;
use warnings;
use DNS::LDNS ':all';
-use Carp 'croak';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my $class = shift;
@@ -19,17 +18,19 @@ sub new {
$rr = _new;
}
elsif (scalar(@_) == 1) {
- $rr = _new_from_str($_[0], $DNS::LDNS::DEFAULT_TTL,
- $DNS::LDNS::DEFAULT_ORIGIN, $status);
+ $rr = _new_from_str($_[0], 0,
+ undef, undef,
+ $status);
}
else {
my %args = @_;
if ($args{str}) {
$rr = _new_from_str($args{str},
- $args{default_ttl} || $DNS::LDNS::DEFAULT_TTL,
- $args{origin} || $DNS::LDNS::DEFAULT_ORIGIN,
- $status);
+ $args{default_ttl} || 0,
+ $args{origin},
+ $args{prev} ? ${$args{prev}} : undef,
+ $status);
}
elsif ($args{filename} or $args{file}) {
my $line_nr = 0;
@@ -43,10 +44,13 @@ sub new {
$file = \*FILE;
}
+ my $ttl = 0;
$rr = _new_from_file($file,
- $args{default_ttl} || $DNS::LDNS::DEFAULT_TTL,
- $args{origin} || $DNS::LDNS::DEFAULT_ORIGIN,
- $status, $line_nr);
+ $args{default_ttl} ? ${$args{default_ttl}} : $ttl,
+ $args{origin} ? ${$args{origin}} : undef,
+ $args{prev} ? ${$args{prev}} : undef,
+ $status,
+ $line_nr);
if ($args{filename}) {
close $file;
}
@@ -56,11 +60,11 @@ sub new {
elsif ($args{type}) {
$rr = _new_from_type($args{type});
if ($args{owner}) {
- $rr->set_owner(new DNS::LDNS::RData(
- &LDNS_RDF_TYPE_DNAME, $args{owner}));
+ $rr->set_owner(ref $args{owner} ? $args{owner} :
+ new DNS::LDNS::RData(&LDNS_RDF_TYPE_DNAME, $args{owner}));
}
- $rr->set_ttl($args{ttl} || $DNS::LDNS::DEFAULT_TTL);
- $rr->set_class($args{class} || $DNS::LDNS::DEFAULT_CLASS);
+ $rr->set_ttl($args{ttl}) if ($args{ttl});
+ $rr->set_class($args{class}) if ($args{class});
if ($args{rdata}) {
if (!$rr->set_rdata(@{$args{rdata}})) {
@@ -369,21 +373,26 @@ DNS::LDNS::RR - Resource record
my rr = new DNS::LDNS::RR('mylabel 3600 IN A 168.10.10.10')
my rr = new DNS::LDNS::RR(
str => 'mylabel 3600 IN A 168.10.10.10',
- default_ttl => 3600, # optional,
- origin => new DNS::LDNS::RData(LDNS_RDF_TYPE_NAME, 'myzone.'), " # optional
+ default_ttl => 3600, # optional
+ origin => $origin_rdata, # optional
+ prev => \$prev_rdata, # optional
)
my rr = new DNS::LDNS::RR(
filename => '/path/to/rr',
- origin => ...)
+ default_ttl => \$ttl, # optional
+ origin => \$origin_rdata, # optional
+ prev => \$prev_rdata) # optional
my rr = new DNS::LDNS::RR(
file => \*FILE,
- origin => ...)
+ default_ttl => \$ttl, # optional
+ origin => \$origin_rdata, # optional
+ prev => \$prev_rdata) # optional
my rr = new DNS::LDNS::RR(
type => LDNS_RR_TYPE_A,
rdata => [new DNS::LDNS::RData(...), new DNS::LDNS::RData(...), ...],
class => LDNS_RR_CLASS_IN, # optional
ttl => 3600, # optional
- owner => new DNS::LDNS::RData(LDNS_RDF_TYPE_NAME, 'mylabel'), # optional)
+ owner => new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'mylabel'), # optional)
my rr = new DNS::LDNS::RR
rr2 = rr->clone
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm
index 11570acbcdde..7fdbd59db1dd 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm
index 111e64f0b7ec..fe4e10eff1cb 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm
index a42beace7288..7f479275c418 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
@@ -25,12 +25,15 @@ sub new {
$file = \*FILE;
}
+ elsif ($args{file}) {
+ $file = $args{file};
+ }
if ($file) {
$zone = _new_from_file($file,
- $args{origin} || $DNS::LDNS::DEFAULT_ORIGIN,
- $args{default_ttl} || $DNS::LDNS::DEFAULT_TTL,
- $args{class} || $DNS::LDNS::DEFAULT_CLASS,
+ $args{origin},
+ $args{default_ttl} || 0,
+ $args{class} || 0,
$status, $line_nr);
}
else {