use
5.008008;
our
$VERSION
=
'0.63'
;
sub
new {
my
(
$class
,
%args
) =
@_
;
my
$line_nr
;
my
$status
=
&DNS::LDNS::LDNS_STATUS_OK
;
my
$zone
;
my
$file
;
if
(
$args
{filename}) {
unless
(
open
FILE,
$args
{filename}) {
$DNS::LDNS::last_status
=
&DNS::LDNS::LDNS_STATUS_FILE_ERR
;
$DNS::LDNS::line_nr
= 0;
return
;
}
$file
= \
*FILE
;
}
elsif
(
$args
{file}) {
$file
=
$args
{file};
}
if
(
$file
) {
$zone
= _new_from_file(
$file
,
$args
{origin},
$args
{ttl} || 0,
$args
{class} || 0,
$status
,
$line_nr
);
}
else
{
$zone
= _new();
}
if
(
$args
{filename}) {
close
$file
;
}
$DNS::LDNS::last_status
=
$status
;
$DNS::LDNS::line_nr
=
$line_nr
;
if
(!
defined
$zone
) {
return
;
}
return
$zone
;
}
sub
soa {
my
$self
=
shift
;
return
DNS::LDNS::GC::own(
$self
->_soa,
$self
);
}
sub
names {
my
$self
=
shift
;
return
DNS::LDNS::GC::own(
$self
->_names,
$self
);
}
sub
find_rrset {
my
(
$self
,
$name
,
$type
) =
@_
;
return
DNS::LDNS::GC::own(
$self
->_find_rrset(
$name
,
$type
),
$self
);
}
sub
add_rr {
my
(
$self
,
$rr
) =
@_
;
my
$s
= _add_rr(
$self
,
my
$copy
=
$rr
->clone);
$DNS::LDNS::last_status
=
$s
;
DNS::LDNS::GC::own(
$copy
,
$self
);
return
$s
;
}
sub
add_empty_nonterminals {
my
$self
=
shift
;
my
$s
= _add_empty_nonterminals(
$self
);
$DNS::LDNS::last_status
=
$s
;
return
$s
;
}
sub
mark_glue {
my
$self
=
shift
;
my
$s
= _mark_glue(
$self
);
$DNS::LDNS::last_status
=
$s
;
return
$s
;
}
sub
sign {
my
(
$self
,
$keylist
,
$policy
,
$flags
) =
@_
;
my
$s
= _sign(
$self
,
$keylist
,
$policy
,
$flags
);
$DNS::LDNS::last_status
=
$s
;
return
$s
;
}
sub
sign_nsec3 {
my
(
$self
,
$keylist
,
$policy
,
$algorithm
,
$flags
,
$iterations
,
$salt
,
$signflags
) =
@_
;
my
$s
= _sign_nsec3(
$self
,
$keylist
,
$policy
,
$algorithm
,
$flags
,
$iterations
,
$salt
,
$signflags
);
$DNS::LDNS::last_status
=
$s
;
return
$s
;
}
sub
to_string {
return
"DNS::LDNS::DNSSecZone::to_string is not yet implemented"
;
}
sub
DESTROY {
DNS::LDNS::GC::free(
$_
[0]);
}
1;