| 1 |
package DNS::LDNS::DNSSecRRs; |
| 2 |
|
| 3 |
use 5.008008; |
| 4 |
use strict; |
| 5 |
use warnings; |
| 6 |
|
| 7 |
use DNS::LDNS; |
| 8 |
|
| 9 |
our $VERSION = '0.61'; |
| 10 |
|
| 11 |
# Note: This class does not have a constructor. Thus, it can not be created |
| 12 |
# as an individual object. The data structure of the node is owned |
| 13 |
# and freed by the owner of the parent rather than the parent node. This |
| 14 |
# is to prevent deep recursion on DESTROY. |
| 15 |
|
| 16 |
sub to_string { |
| 17 |
my $self = shift; |
| 18 |
my $ret = ''; |
| 19 |
while ($self and $self->rr) { |
| 20 |
$ret .= $self->rr->to_string; |
| 21 |
$self = $self->next; |
| 22 |
} |
| 23 |
|
| 24 |
return $ret; |
| 25 |
} |
| 26 |
|
| 27 |
sub add_rr { |
| 28 |
my ($self, $rr) = @_; |
| 29 |
|
| 30 |
my $s = _add_rr($self, my $copy = $rr->clone); |
| 31 |
DNS::LDNS::GC::own($self, $copy); |
| 32 |
$DNS::LDNS::last_status = $s; |
| 33 |
return $s; |
| 34 |
} |
| 35 |
|
| 36 |
sub rr { |
| 37 |
my $self = shift; |
| 38 |
return DNS::LDNS::GC::own($self->_rr, DNS::LDNS::GC::owner($self)); |
| 39 |
} |
| 40 |
|
| 41 |
sub next { |
| 42 |
my $self = shift; |
| 43 |
return DNS::LDNS::GC::own($self->_next, DNS::LDNS::GC::owner($self)); |
| 44 |
} |
| 45 |
|
| 46 |
sub DESTROY { |
| 47 |
DNS::LDNS::GC::free($_[0]); |
| 48 |
} |
| 49 |
|
| 50 |
1; |
| 51 |
__END__ |
| 52 |
|
| 53 |
=head1 NAME |
| 54 |
|
| 55 |
DNS::LDNS::DNSSecRRs - Linked list of rrs in a dnssec zone |
| 56 |
|
| 57 |
=head1 SYNOPSIS |
| 58 |
|
| 59 |
use DNS::LDNS ':all' |
| 60 |
|
| 61 |
rrs->to_string |
| 62 |
rrs->add_rr(rr) |
| 63 |
rr = rrs->rr |
| 64 |
rrs2 = rrs->next |
| 65 |
|
| 66 |
=head1 SEE ALSO |
| 67 |
|
| 68 |
http://www.nlnetlabs.nl/projects/ldns |
| 69 |
|
| 70 |
=head1 AUTHOR |
| 71 |
|
| 72 |
Erik Pihl Ostlyngen, E<lt>[email protected]<gt> |
| 73 |
|
| 74 |
=head1 COPYRIGHT AND LICENSE |
| 75 |
|
| 76 |
Copyright (C) 2013 by UNINETT Norid AS |
| 77 |
|
| 78 |
This library is free software; you can redistribute it and/or modify |
| 79 |
it under the same terms as Perl itself, either Perl version 5.14.2 or, |
| 80 |
at your option, any later version of Perl 5 you may have available. |
| 81 |
|
| 82 |
=cut |