Debian Codegraph @

contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm

raw
1 package DNS::LDNS::DNSSecTrustTree;
2
3 use 5.008008;
4 use strict;
5 use warnings;
6
7 use DNS::LDNS;
8
9 our $VERSION = '0.61';
10
11 sub add_parent {
12 my ($self, $parent, $sig, $parent_status) = @_;
13
14 if (DNS::LDNS::GC::is_owned($parent)) {
15 die "Cannot add to multiple trees.";
16 }
17 my $s = _add_parent($self, $parent, $sig, $parent_status);
18 DNS::LDNS::GC::own($parent, $self);
19 $DNS::LDNS::last_status = $s;
20 return $s;
21 }
22
23 sub contains_keys {
24 my ($self, $trusted_keys) = @_;
25
26 my $s = _contains_keys($self, $trusted_keys);
27 $DNS::LDNS::last_status = $s;
28 return $s;
29 }
30
31 sub rr {
32 my $self = shift;
33 return DNS::LDNS::GC::own($self->_rr, $self);
34 }
35
36 sub rrset {
37 my $self = shift;
38 return DNS::LDNS::GC::own($self->_rrset, $self);
39 }
40
41 sub parent {
42 my ($self, $i) = @_;
43 return DNS::LDNS::GC::own($self->_parent($i), $self);
44 }
45
46 sub parent_status {
47 my ($self, $i) = @_;
48 my $s = _parent_status($self, $i);
49 $DNS::LDNS::last_status = $s;
50 return $s;
51 }
52
53 sub parent_signature {
54 my ($self, $i) = @_;
55 return DNS::LDNS::GC::own($self->_parent_signature($i), $self);
56 }
57
58 1;
59 __END__
60
61 =head1 NAME
62
63 DNS::LDNS::DNSSecTrustTree - Trust tree from signed RR to trust anchors
64
65 =head1 SYNOPSIS
66
67 use DNS::LDNS ':all'
68
69 tree = new DNS::LDNS::DNSSecTrustTree
70 tree->print(fp)
71 d = tree->depth
72 status = tree->add_parent(parent, sig, parent_status)
73 status = tree->contains_keys(trusted_keys)
74
75 # Node attributes
76 rr = tree->rr;
77 rrset = tree->rrset
78 ptree = tree->parent(i)
79 pstatus = tree->parent_status(i)
80 rr = tree->parent_signature(i)
81 count = tree->parent_count
82
83 =head1 SEE ALSO
84
85 http://www.nlnetlabs.nl/projects/ldns
86
87 =head1 AUTHOR
88
89 Erik Pihl Ostlyngen, E<lt>[email protected]<gt>
90
91 =head1 COPYRIGHT AND LICENSE
92
93 Copyright (C) 2013 by UNINETT Norid AS
94
95 This library is free software; you can redistribute it and/or modify
96 it under the same terms as Perl itself, either Perl version 5.14.2 or,
97 at your option, any later version of Perl 5 you may have available.
98
99 =cut