Changeset 452 for trunk/DNSDB.pm
- Timestamp:
- 01/11/13 12:21:13 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r451 r452 52 52 &addRec &updateRec &delRec 53 53 &getLogCount &getLogEntries 54 &getRevPattern 54 55 &getTypelist 55 56 &parentID 56 57 &isParent 57 &zoneStatus & importAXFR58 &zoneStatus &getZonesByCIDR &importAXFR 58 59 &export 59 60 &mailNotify … … 79 80 &addRec &updateRec &delRec 80 81 &getLogCount &getLogEntries 82 &getRevPattern 81 83 &getTypelist 82 84 &parentID 83 85 &isParent 84 &zoneStatus & importAXFR86 &zoneStatus &getZonesByCIDR &importAXFR 85 87 &export 86 88 &mailNotify … … 3926 3928 3927 3929 3930 ## IPDB::getRevPattern() 3931 # Get the narrowest template pattern applicable to a passed CIDR address (may be a netblock or an IP) 3932 sub getRevPattern { 3933 my $dbh = shift; 3934 my $cidr = shift; 3935 my $group = shift || 1; # just in case 3936 3937 my ($revpatt) = $dbh->selectrow_array("SELECT r.host FROM records r JOIN revzones z ON r.rdns_id=z.rdns_id ". 3938 "WHERE r.type=65282 OR r.type=65283 AND z.group_id=? AND CAST (r.val AS inet) >>= ? ". 3939 "ORDER BY CAST (r.val AS inet) DESC LIMIT 1", undef, ($group, $cidr) ); 3940 return $revpatt; 3941 } # end getRevPattern() 3942 3943 3928 3944 ## DNSDB::getTypelist() 3929 3945 # Get a list of record types for various UI dropdowns … … 4153 4169 return $status; 4154 4170 } # end zoneStatus() 4171 4172 4173 ## DNSDB::getZonesByCIDR() 4174 # Get a list of zone names and IDs that records for a passed CIDR block are within. 4175 sub getZonesByCIDR { 4176 my $dbh = shift; 4177 my %args = @_; 4178 4179 my $result = $dbh->selectall_arrayref("SELECT rdns_id,revnet FROM revzones WHERE revnet >>= ? OR revnet <<= ?", 4180 { Slice => {} }, ($args{cidr}, $args{cidr}) ); 4181 return $result; 4182 } # end getZonesByCIDR() 4155 4183 4156 4184
Note:
See TracChangeset
for help on using the changeset viewer.