Ignore:
Timestamp:
12/11/13 15:45:18 (11 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Merge reverse DNS work and object conversion from /trunk, 4 of mumble

Includes changes through r492 with a few minor conflicts.

Location:
branches/stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable

  • branches/stable/dns-rpc.cgi

    r546 r547  
    2424# don't remove!  required for GNU/FHS-ish install from tarball
    2525use lib '.';    ##uselib##
    26 
    27 use DNSDB;      # note we're not importing subs;  this lets us (ab)use the same sub names here for convenience
    28 use Data::Dumper;
    29 
     26use DNSDB;
     27
     28use FCGI;
    3029#use Frontier::RPC2;
    3130use Frontier::Responder;
     
    3938#package main;
    4039
    41 DNSDB::loadConfig(rpcflag => 1);
    42 
    43 # need to create a DNSDB object too
    44 my ($dbh,$msg) = DNSDB::connectDB($DNSDB::config{dbname}, $DNSDB::config{dbuser},
    45         $DNSDB::config{dbpass}, $DNSDB::config{dbhost});
    46 
    47 DNSDB::initGlobals($dbh);
     40my $dnsdb = DNSDB->new();
    4841
    4942my $methods = {
     
    5649        'dnsdb.updateUser'      => \&updateUser,
    5750        'dnsdb.delUser'         => \&delUser,
     51        'dnsdb.getLocDropdown'  => \&getLocDropdown,
    5852        'dnsdb.getSOA'          => \&getSOA,
    5953        'dnsdb.getRecLine'      => \&getRecLine,
     
    6256        'dnsdb.addRec'          => \&addRec,
    6357        'dnsdb.updateRec'       => \&updateRec,
     58        'dnsdb.addOrUpdateRevRec'       => \&addOrUpdateRevRec,
    6459        'dnsdb.delRec'          => \&delRec,
     60        'dnsdb.delByCIDR'       => \&delByCIDR,
     61#sub getLogCount {}
     62#sub getLogEntries {}
     63        'dnsdb.getRevPattern'   => \&getRevPattern,
    6564        'dnsdb.zoneStatus'      => \&zoneStatus,
     65        'dnsdb.getZonesByCIDR'  => \&getZonesByCIDR,
    6666
    6767        'dnsdb.getMethods'      => \&get_method_list
    6868};
    6969
    70 my $res = Frontier::Responder->new(
     70my $reqcnt = 0;
     71
     72while (FCGI::accept >= 0) {
     73  my $res = Frontier::Responder->new(
    7174        methods => $methods
    7275        );
    7376
    74 # "Can't do that" errors
    75 if (!$dbh) {
    76   print "Content-type: text/xml\n\n".$res->{_decode}->encode_fault(5, $msg);
    77   exit;
    78 }
    79 ##fixme:  fail on missing rpcuser/rpcsystem args
    80 
    81 print $res->answer;
     77  # "Can't do that" errors
     78  if (!$dnsdb) {
     79    print "Content-type: text/xml\n\n".$res->{_decode}->encode_fault(5, $dnsdb->err);
     80  } else {
     81    print $res->answer;
     82  }
     83  last if $reqcnt++ > $dnsdb->{maxfcgi};
     84} # while FCGI::accept
     85
    8286
    8387exit;
     
    8791##
    8892
    89 # Utility subs
     93# Check RPC ACL
    9094sub _aclcheck {
    9195  my $subsys = shift;
    92   return 1 if grep /$ENV{REMOTE_ADDR}/, @{$DNSDB::config{rpcacl}{$subsys}};
     96  return 1 if grep /$ENV{REMOTE_ADDR}/, @{$dnsdb->{rpcacl}{$subsys}};
    9397  return 0;
    9498}
     
    104108    die "Missing remote username\n" if !$argref->{rpcuser};
    105109    die "Couldn't set userdata for logging\n"
    106         unless DNSDB::initRPC($dbh, (username => $argref->{rpcuser}, rpcsys => $argref->{rpcsystem},
    107                 fullname => ($argref->{fullname} ? $argref->{fullname} : $argref->{rpcuser}) ) );
     110        unless $dnsdb->initRPC(username => $argref->{rpcuser}, rpcsys => $argref->{rpcsystem},
     111                fullname => ($argref->{fullname} ? $argref->{fullname} : $argref->{rpcuser}) );
     112  }
     113}
     114
     115# set location to the zone's default location if none is specified
     116sub _loccheck {
     117  my $argref = shift;
     118  if (!$argref->{location} && $argref->{defrec} eq 'n') {
     119    $argref->{location} = $dnsdb->getZoneLocation($argref->{revrec}, $argref->{parent_id});
     120  }
     121}
     122
     123# set ttl to zone defailt minttl if none is specified
     124sub _ttlcheck {
     125  my $argref = shift;
     126  if (!$argref->{ttl}) {
     127    my $tmp = $dnsdb->getSOA($argref->{defrec}, $argref->{revrec}, $argref->{parent_id});
     128    $argref->{ttl} = $tmp->{minttl};
    108129  }
    109130}
     
    124145  _commoncheck(\%args, 'y');
    125146
    126   my ($code, $msg) = DNSDB::addDomain($dbh, $args{domain}, $args{group}, $args{state});
     147  my ($code, $msg) = $dnsdb->addDomain($args{domain}, $args{group}, $args{state});
    127148  die $msg if $code eq 'FAIL';
    128149  return $msg;  # domain ID
     
    138159  # Let's be nice;  delete based on zone id OR zone name.  Saves an RPC call round-trip, maybe.
    139160  if ($args{zone} =~ /^\d+$/) {
    140     ($code,$msg) = DNSDB::delZone($dbh, $args{zone}, $args{revrec});
     161    ($code,$msg) = $dnsdb->delZone($args{zone}, $args{revrec});
    141162  } else {
    142163    my $zoneid;
    143     $zoneid = DNSDB::domainID($dbh, $args{zone}) if $args{revrec} eq 'n';
    144     $zoneid = DNSDB::revID($dbh, $args{zone}) if $args{revrec} eq 'y';
    145     die "Can't find zone: $DNSDB::errstr\n" if !$zoneid;
    146     ($code,$msg) = DNSDB::delZone($dbh, $zoneid, $args{revrec});
     164    $zoneid = $dnsdb->domainID($args{zone}) if $args{revrec} eq 'n';
     165    $zoneid = $dnsdb->revID($args{zone}) if $args{revrec} eq 'y';
     166    die "Can't find zone: $dnsdb->errstr\n" if !$zoneid;
     167    ($code,$msg) = $dnsdb->delZone($zoneid, $args{revrec});
    147168  }
    148169  die $msg if $code eq 'FAIL';
     
    160181  _commoncheck(\%args, 'y');
    161182
    162   my ($code, $msg) = DNSDB::addRDNS($dbh, $args{revzone}, $args{revpatt}, $args{group}, $args{state});
    163   die $msg if $code eq 'FAIL';
     183  my ($code, $msg) = $dnsdb->addRDNS($args{revzone}, $args{revpatt}, $args{group}, $args{state}, $args{defloc});
     184  die "$msg\n" if $code eq 'FAIL';
    164185  return $msg;  # domain ID
    165186}
     
    182203        };
    183204## optional $inhert arg?
    184   my ($code,$msg) = DNSDB::addGroup($dbh, $args{groupname}, $args{parent_id}, $perms);
     205  my ($code,$msg) = $dnsdb->addGroup($args{groupname}, $args{parent_id}, $perms);
    185206  die $msg if $code eq 'FAIL';
    186207  return $msg;
     
    196217  # Let's be nice;  delete based on groupid OR group name.  Saves an RPC call round-trip, maybe.
    197218  if ($args{group} =~ /^\d+$/) {
    198     ($code,$msg) = DNSDB::delGroup($dbh, $args{group});
     219    ($code,$msg) = $dnsdb->delGroup($args{group});
    199220  } else {
    200     my $grpid = DNSDB::groupID($dbh, $args{group});
     221    my $grpid = $dnsdb->groupID($args{group});
    201222    die "Can't find group\n" if !$grpid;
    202     ($code,$msg) = DNSDB::delGroup($dbh, $grpid);
     223    ($code,$msg) = $dnsdb->delGroup($grpid);
    203224  }
    204225  die $msg if $code eq 'FAIL';
     
    227248    push @userargs, $args{$argname};
    228249  }
    229   my ($code,$msg) = DNSDB::addUser($dbh, @userargs);
     250  my ($code,$msg) = $dnsdb->addUser(@userargs);
    230251  die $msg if $code eq 'FAIL';
    231252  return $msg;
     
    253274##fixme:  also underlying in DNSDB::updateUser():  no way to just update this or that attribute;
    254275#         have to pass them all in to be overwritten
    255   my ($code,$msg) = DNSDB::updateUser($dbh, @userargs);
     276  my ($code,$msg) = $dnsdb->updateUser(@userargs);
    256277  die $msg if $code eq 'FAIL';
    257278  return $msg;
     
    264285
    265286  die "Missing UID\n" if !$args{uid};
    266   my ($code,$msg) = DNSDB::delUser($dbh, $args{uid});
     287  my ($code,$msg) = $dnsdb->delUser($args{uid});
    267288  die $msg if $code eq 'FAIL';
    268289  return $msg;
     
    279300#sub getLocCount {}
    280301#sub getLocList {}
    281 #sub getLocDropdown {}
     302
     303sub getLocDropdown {
     304  my %args = @_;
     305
     306  _commoncheck(\%args);
     307  $args{defloc} = '' if !$args{defloc};
     308
     309  my $ret = $dnsdb->getLocDropdown($args{group}, $args{defloc});
     310  return $ret;
     311}
    282312
    283313sub getSOA {
     
    286316  _commoncheck(\%args);
    287317
    288   my $ret = DNSDB::getSOA($dbh, $args{defrec}, $args{revrec}, $args{id});
     318  my $ret = $dnsdb->getSOA($args{defrec}, $args{revrec}, $args{id});
    289319  if (!$ret) {
    290320    if ($args{defrec} eq 'y') {
     
    304334  _commoncheck(\%args);
    305335
    306   my $ret = DNSDB::getRecLine($dbh, $args{defrec}, $args{revrec}, $args{id});
    307 
    308   die $DNSDB::errstr if !$ret;
     336  my $ret = $dnsdb->getRecLine($args{defrec}, $args{revrec}, $args{id});
     337
     338  die $dnsdb->errstr if !$ret;
    309339
    310340  return $ret;
     
    323353  $args{direction} = 'ASC' if !$args{direction};
    324354
    325   my $ret = DNSDB::getDomRecs($dbh, (defrec => $args{defrec}, revrec => $args{revrec}, id => $args{id},
     355  my $ret = $dnsdb->getDomRecs(defrec => $args{defrec}, revrec => $args{revrec}, id => $args{id},
    326356        offset => $args{offset}, sortby => $args{sortby}, sortorder => $args{sortorder},
    327         filter => $args{filter}) );
    328 
    329   die $DNSDB::errstr if !$ret;
     357        filter => $args{filter});
     358
     359  die $dnsdb->errstr if !$ret;
    330360
    331361  return $ret;
     
    344374  $args{direction} = 'ASC' if !$args{direction};
    345375
    346   my $ret = DNSDB::getRecCount($dbh, $args{defrec}, $args{revrec}, $args{id}, $args{filter});
    347 
    348   die $DNSDB::errstr if !$ret;
     376  my $ret = $dnsdb->getRecCount($args{defrec}, $args{revrec}, $args{id}, $args{filter});
     377
     378  die $dnsdb->errstr if !$ret;
    349379
    350380  return $ret;
     
    356386  _commoncheck(\%args, 'y');
    357387
    358   # add records in the zone's default location if none is specified
    359   if (!$args{location} && $args{defrec} eq 'n') {
    360     $args{location} = DNSDB::getZoneLocation($dbh, $args{revrec}, $args{parent_id});
    361   }
    362 
    363   my @recargs = ($dbh, $args{defrec}, $args{revrec}, $args{parent_id},
     388  _loccheck(\%args);
     389  _ttlcheck(\%args);
     390
     391  my @recargs = ($args{defrec}, $args{revrec}, $args{parent_id},
    364392        \$args{name}, \$args{type}, \$args{address}, $args{ttl}, $args{location});
    365393  if ($args{type} == $DNSDB::reverse_typemap{MX} or $args{type} == $DNSDB::reverse_typemap{SRV}) {
     
    371399  }
    372400
    373   my ($code, $msg) = DNSDB::addRec(@recargs);
     401  my ($code, $msg) = $dnsdb->addRec(@recargs);
    374402
    375403  die $msg if $code eq 'FAIL';
     
    381409
    382410  _commoncheck(\%args, 'y');
     411
     412  # get old line, so we can update only the bits that the caller passed to change
     413  # note we subbed address for val since it's a little more caller-friendly
     414  my $oldrec = $dnsdb->getRecLine($args{defrec}, $args{revrec}, $args{id});
     415  foreach my $field (qw(name type address ttl location distance weight port)) {
     416    $args{$field} = $oldrec->{$field} if !$args{$field} && defined($oldrec->{$field});
     417  }
    383418
    384419  # note dist, weight, port are not required on all types;  will be ignored if not needed.
    385420  # parent_id is the "primary" zone we're updating;  necessary for forward/reverse voodoo
    386   my ($code, $msg) = DNSDB::updateRec($dbh, $args{defrec}, $args{revrec}, $args{id}, $args{parent_id},
     421  my ($code, $msg) = $dnsdb->updateRec($args{defrec}, $args{revrec}, $args{id}, $args{parent_id},
    387422        \$args{name}, \$args{type}, \$args{address}, $args{ttl}, $args{location},
    388423        $args{distance}, $args{weight}, $args{port});
     
    392427}
    393428
     429# Takes a passed CIDR block and DNS pattern;  adds a new record or updates the record(s) affected
     430sub addOrUpdateRevRec {
     431  my %args = @_;
     432
     433  _commoncheck(\%args, 'y');
     434  my $cidr = new NetAddr::IP $args{cidr};
     435
     436  my $zonelist = $dnsdb->getZonesByCIDR(%args);
     437  if (scalar(@$zonelist) == 0) {
     438    # enhh....  WTF?
     439  } elsif (scalar(@$zonelist) == 1) {
     440    # check if the single zone returned is bigger than the CIDR.  if so, we can just add a record
     441    my $zone = new NetAddr::IP $zonelist->[0]->{revnet};
     442    if ($zone->contains($cidr)) {
     443      # We need to strip the CIDR mask on IPv4 /32 assignments, or we just add a new record all the time.
     444      my $filt = ($cidr->{isv6} || $cidr->masklen != 32 ? "$cidr" : $cidr->addr);
     445      my $reclist = $dnsdb->getDomRecs(defrec => 'n', revrec => 'y',
     446        id => $zonelist->[0]->{rdns_id}, filter => $filt);
     447      if (scalar(@$reclist) == 0) {
     448        # Aren't Magic Numbers Fun?  See pseudotype list in dnsadmin.
     449        my $type = ($cidr->{isv6} ? 65284 : ($cidr->masklen == 32 ? 65280 : 65283) );
     450        addRec(defrec =>'n', revrec => 'y', parent_id => $zonelist->[0]->{rdns_id}, type => $type,
     451          address => "$cidr", %args);
     452      } else {
     453        my $flag = 0;
     454        foreach my $rec (@$reclist) {
     455          # pure PTR plus composite types
     456          next unless $rec->{type} == 12 || $rec->{type} == 65280 || $rec->{type} == 65281
     457                || $rec->{type} == 65282 || $rec->{type} == 65283 || $rec->{type} == 65284;
     458          next unless $rec->{val} eq $filt;     # make sure we really update the record we want to update.
     459          $dnsdb->updateRec(defrec =>'n', revrec => 'y', id => $rec->{record_id},
     460            parent_id => $zonelist->[0]->{rdns_id}, %args);
     461          $flag = 1;
     462          last; # only do one record.
     463        }
     464        unless ($flag) {
     465          # Nothing was updated, so we didn't really have a match.  Add as per @$reclist==0
     466          # Aren't Magic Numbers Fun?  See pseudotype list in dnsadmin.
     467          my $type = ($cidr->{isv6} ? 65282 : ($cidr->masklen == 32 ? 65280 : 65283) );
     468          $dnsdb->addRec(defrec =>'n', revrec => 'y', parent_id => $zonelist->[0]->{rdns_id}, type => $type,
     469            address => "$cidr", %args);
     470        }
     471      }
     472    } else {
     473      # ebbeh?  CIDR is only partly represented in DNS.  This needs manual intervention.
     474    } # done single-zone-contains-$cidr
     475  } else {
     476    # Overlapping reverse zones shouldn't be possible, so if we're here we've got a CIDR
     477    # that spans multiple reverse zones (eg, /23 CIDR -> 2 /24 rzones)
     478    foreach my $zdata (@$zonelist) {
     479      my $reclist = $dnsdb->getDomRecs(defrec => 'n', revrec => 'y',
     480        id => $zdata->{rdns_id}, filter => $zdata->{revnet});
     481      if (scalar(@$reclist) == 0) {
     482        my $type = ($args{cidr}->{isv6} ? 65282 : ($args{cidr}->masklen == 32 ? 65280 : 65283) );
     483        $dnsdb->addRec(defrec =>'n', revrec => 'y', parent_id => $zdata->{rdns_id}, type => $type,
     484          address => "$args{cidr}", %args);
     485      } else {
     486        foreach my $rec (@$reclist) {
     487          # only the composite and/or template types;  pure PTR or nontemplate composite
     488          # types are nominally impossible here.
     489          next unless $rec->{type} == 65282 || $rec->{type} == 65283 || $rec->{type} == 65284;
     490          $dnsdb->updateRec(defrec =>'n', revrec => 'y', id => $rec->{record_id},
     491            parent_id => $zdata->{rdns_id}, %args);
     492          last; # only do one record.
     493        }
     494      }
     495    } # iterate zones within $cidr
     496  } # done $cidr-contains-zones
     497}
     498
    394499sub delRec {
    395500  my %args = @_;
     
    397502  _commoncheck(\%args, 'y');
    398503
    399   my ($code, $msg) = DNSDB::delRec($dbh, $args{defrec}, $args{recrev}, $args{id});
    400 
    401   die $msg if $code eq 'FAIL';
    402   return $msg;
    403 }
     504  my ($code, $msg) = $dnsdb->delRec($args{defrec}, $args{recrev}, $args{id});
     505
     506  die $msg if $code eq 'FAIL';
     507  return $msg;
     508}
     509
     510sub delByCIDR {
     511  my %args = @_;
     512
     513  _commoncheck(\%args, 'y');
     514
     515  # much like addOrUpdateRevRec()
     516  my $zonelist = $dnsdb->getZonesByCIDR(%args);
     517  my $cidr = new NetAddr::IP $args{cidr};
     518
     519  if (scalar(@$zonelist) == 0) {
     520    # enhh....  WTF?
     521  } elsif (scalar(@$zonelist) == 1) {
     522
     523    # check if the single zone returned is bigger than the CIDR
     524    my $zone = new NetAddr::IP $zonelist->[0]->{revnet};
     525    if ($zone->contains($cidr)) {
     526
     527      if ($args{delsubs}) {
     528        # Delete ALL EVARYTHING!!one11!! in $args{cidr}
     529        my $reclist = $dnsdb->getDomRecs(defrec => 'n', revrec => 'y', id => $zonelist->[0]->{rdns_id});
     530        foreach my $rec (@$reclist) {
     531          my $reccidr = new NetAddr::IP $rec->{val};
     532          next unless $cidr->contains($reccidr);
     533          next unless $rec->{type} == 12 || $rec->{type} == 65280 || $rec->{type} == 65281 ||
     534                      $rec->{type} == 65282 || $rec->{type} == 65283 ||$rec->{type} == 65284;
     535          ##fixme:  multiple records, wanna wax'em all, how to report errors?
     536          if ($args{delforward} ||
     537              $rec->{type} == 12 || $rec->{type} == 65282 ||
     538              $rec->{type} == 65283 || $rec->{type} == 65284) {
     539            my ($code,$msg) = $dnsdb->delRec('n', 'y', $rec->{record_id});
     540          } else {
     541            my $ret = $dnsdb->downconvert($rec->{record_id}, $DNSDB::reverse_typemap{A});
     542          }
     543        }
     544        if ($args{parpatt} && $zone == $cidr) {
     545          # Edge case;  we've just gone and axed all the records in the reverse zone.
     546          # Re-add one to match the parent if we've been given a pattern to use.
     547          $dnsdb->addRec(defrec =>'n', revrec => 'y', parent_id => $zonelist->[0]->{rdns_id},
     548                 type => ($zone->{isv6} ? 65284 : 65283), address => "$cidr", %args);
     549        }
     550
     551      } else {
     552        # Selectively delete only exact matches on $args{cidr}
     553
     554        # We need to strip the CIDR mask on IPv4 /32 assignments, or we can't find single-IP records
     555        my $filt = ($cidr->{isv6} || $cidr->masklen != 32 ? "$cidr" : $cidr->addr);
     556        my $reclist = $dnsdb->getDomRecs(defrec => 'n', revrec => 'y',
     557          id => $zonelist->[0]->{rdns_id}, filter => $filt, sortby => 'val', sortorder => 'DESC');
     558        foreach my $rec (@$reclist) {
     559          my $reccidr = new NetAddr::IP $rec->{val};
     560          next unless $cidr == $reccidr;
     561          next unless $rec->{type} == 12 || $rec->{type} == 65280 || $rec->{type} == 65281 ||
     562                      $rec->{type} == 65282 || $rec->{type} == 65283 ||$rec->{type} == 65284;
     563          if ($args{delforward} || $rec->{type} == 12) {
     564            my ($code,$msg) = $dnsdb->delRec('n', 'y', $rec->{record_id});
     565            die $msg if $code eq 'FAIL';
     566            return $msg;
     567          } else {
     568            my $ret = $dnsdb->downconvert($rec->{record_id}, $DNSDB::reverse_typemap{A});
     569            die $dnsdb->errstr if !$ret;
     570            return "A+PTR for $args{cidr} split and PTR removed";
     571          }
     572        } # foreach @$reclist
     573      }
     574
     575    } else {  # $cidr > $zone but we only have one zone
     576      # ebbeh?  CIDR is only partly represented in DNS.  This needs manual intervention.
     577      return "Warning:  $args{cidr} is only partly represented in DNS.  Check and remove DNS records manually.";
     578    } # done single-zone-contains-$cidr
     579
     580  } else {  # multiple zones nominally "contain" $cidr
     581    # Overlapping reverse zones shouldn't be possible, so if we're here we've got a CIDR
     582    # that spans multiple reverse zones (eg, /23 CIDR -> 2 /24 rzones)
     583    foreach my $zdata (@$zonelist) {
     584      my $reclist = $dnsdb->getDomRecs(defrec => 'n', revrec => 'y', id => $zdata->{rdns_id});
     585      if (scalar(@$reclist) == 0) {
     586# nothing to do?  or do we (re)add a record based on the parent?
     587# yes, yes we do, past the close of the else
     588#        my $type = ($args{cidr}->{isv6} ? 65282 : ($args{cidr}->masklen == 32 ? 65280 : 65283) );
     589#        addRec(defrec =>'n', revrec => 'y', parent_id => $zdata->{rdns_id}, type => $type,
     590#          address => "$args{cidr}", %args);
     591      } else {
     592        foreach my $rec (@$reclist) {
     593          next unless $rec->{type} == 12 || $rec->{type} == 65280 || $rec->{type} == 65281 ||
     594                      $rec->{type} == 65282 || $rec->{type} == 65283 || $rec->{type} == 65284;
     595          # Template types are only useful when attached to a reverse zone.
     596##fixme  ..... or ARE THEY?
     597          if ($args{delforward} ||
     598              $rec->{type} == 12 || $rec->{type} == 65282 ||
     599              $rec->{type} == 65283 || $rec->{type} == 65284) {
     600            my ($code,$msg) = $dnsdb->delRec('n', 'y', $rec->{record_id});
     601          } else {
     602            my $ret = $dnsdb->downconvert($rec->{record_id}, $DNSDB::reverse_typemap{A});
     603          }
     604        } # foreach @$reclist
     605      } # nrecs != 0
     606      if ($args{parpatt}) {
     607        # We've just gone and axed all the records in the reverse zone.
     608        # Re-add one to match the parent if we've been given a pattern to use.
     609        $dnsdb->addRec(defrec =>'n', revrec => 'y', parent_id => $zdata->{rdns_id},
     610               type => ($cidr->{isv6} ? 65284 : 65283),
     611               address => $zdata->{revnet}, name => $args{parpatt}, %args);
     612      }
     613    } # iterate zones within $cidr
     614  } # done $cidr-contains-zones
     615
     616} # end delByCIDR()
    404617
    405618#sub getLogCount {}
    406619#sub getLogEntries {}
     620
     621sub getRevPattern {
     622  my %args = @_;
     623
     624  _commoncheck(\%args, 'y');
     625
     626  return $dnsdb->getRevPattern($args{cidr}, $args{group});
     627}
     628
    407629#sub getTypelist {}
    408630#sub parentID {}
     
    414636  _commoncheck(\%args, 'y');
    415637
    416   my @arglist = ($dbh, $args{zoneid});
     638  my @arglist = ($args{zoneid});
    417639  push @arglist, $args{status} if defined($args{status});
    418640
    419   my $status = DNSDB::zoneStatus(@arglist);
     641  my $status = $dnsdb->zoneStatus(@arglist);
     642}
     643
     644# Get a list of hashes referencing the reverse zone(s) for a passed CIDR block
     645sub getZonesByCIDR {
     646  my %args = @_;
     647
     648  _commoncheck(\%args, 'y');
     649
     650  return $dnsdb->getZonesByCIDR(%args);
    420651}
    421652
Note: See TracChangeset for help on using the changeset viewer.