Changeset 697 for trunk/cgi-bin/IPDB.pm
- Timestamp:
- 02/18/15 17:16:21 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r696 r697 31 31 &listSummary &listSubs &listContainers &listAllocations &listFree &listPool 32 32 &getMasterList &getTypeList &getPoolSelect &findAllocateFrom 33 &ipParent &subParent &blockParent &get RoutedCity33 &ipParent &subParent &blockParent &getBreadCrumbs &getRoutedCity 34 34 &allocateBlock &updateBlock &deleteBlock &getBlockData &getBlockRDNS &getRDNSbyIP 35 35 &getNodeList &getNodeName &getNodeInfo … … 46 46 &listSummary &listSubs &listContainers &listAllocations &listFree &listPool 47 47 &getMasterList &getTypeList &getPoolSelect &findAllocateFrom 48 &ipParent &subParent &blockParent &get RoutedCity48 &ipParent &subParent &blockParent &getBreadCrumbs &getRoutedCity 49 49 &allocateBlock &updateBlock &deleteBlock &getBlockData &getBlockRDNS &getRDNSbyIP 50 50 &getNodeList &getNodeName &getNodeInfo … … 950 950 951 951 952 ## IPDB::getBreadCrumbs() 953 # Retrieve the ID and CIDR of a block's parent(s) up to the master block 954 # Returns an arrayref to a list of hashrefs with CIDR and block ID 955 sub getBreadCrumbs { 956 my $dbh = shift; 957 my $parent = shift; 958 my @result; 959 960 my $sth = $dbh-> prepare("SELECT cidr,type,id,parent_id FROM allocations WHERE id=?"); 961 962 while ($parent != 0) { 963 $sth->execute($parent); 964 my ($cidr,$type,$id,$pid) = $sth->fetchrow_array; 965 push @result, {cidr => $cidr, link => $id, ispool => ($type =~ /^.[dp]$/ ? 1 : 0)}; 966 $parent = $pid; 967 } 968 969 return \@result; 970 } # end getBread() 971 972 952 973 ## IPDB::getRoutedCity() 953 974 # Get the city for a routed block.
Note:
See TracChangeset
for help on using the changeset viewer.