Obsolete
/
dnsmanagerv1
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
dnsmanagerv1/lib/getiface.pm

28 lines
691 B
Perl

package getiface;
use v5.14;
use Exporter 'import';
# what we want to export eventually
our @EXPORT_OK = qw/getiface/;
# bundle of exports (tags)
our %EXPORT_TAGS = ( all => [qw/getiface/] );
use interface::bind9;
use interface::knot;
use interface::nsd3;
use interface::nsd4;
sub getiface {
my ($type, $params) = @_;
for($type) {
if (/bind9/) { return interface::bind9->new($params) }
elsif (/knot/) { return interface::knot->new($params) }
elsif (/nsd3/) { return interface::nsd3->new($params) }
elsif (/nsd/) { return interface::nsd4->new($params) }
else { die "Interface for the $_ dns type not found."; }
}
}
1;