Changeset 746 for trunk/cgi-bin


Ignore:
Timestamp:
06/16/15 17:56:30 (10 years ago)
Author:
Kris Deugau
Message:

/trunk

  • Tweak header docucomment for brief description of scope arguments for mergeBlocks()
  • Adjust return data structure in mergeBlocks() to match and propagate the change in _toPool() in r745. This is needed for properly handling a couple of branches of reverse DNS RPC calls. See #8.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r745 r746  
    21372137#     Convert leaf allocations into free blocks.
    21382138#   clearpeer
    2139 #     Keep subs of the original
    2140 #     Convert assigned IPs from pools into subs.
    2141 #     Convert unused IPs from pools into free blocks.
    2142 #     Convert leaf allocations into free blocks.
     2139#     Keep subs of the original (if it was a container).
     2140#     Convert assigned IPs from the original pool into subs (if it was a pool).
     2141#     Convert unused IPs from the original pool into free blocks (if it was a pool).
     2142#     Delete all peers and their subs aside from the original.
    21432143#   clearall
    21442144#     Delete all peers, subs and IPs.
     
    22722272          $mfbsth->execute($binfo->{master_id}, $m_id) if $peertype eq 'mm';
    22732273          # capture block for return
    2274           push @retlist, { block => $peercidr, mtype => $disp_alloctypes{$peertype} };
     2274          push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype };
    22752275        }
    22762276
     
    23012301              undef, ($peercidr, 'm', $prime, $prime) ) if $binfo->{type} eq 'mm';
    23022302          # capture block for return
    2303           push @retlist, { block => $peercidr, mtype => $disp_alloctypes{$peertype} };
     2303          push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype };
    23042304        }
    23052305        if ($args{scope} eq 'clearall') {
     
    23462346          $mfbsth->execute($binfo->{master_id}, $m_id) if $peertype eq 'mm';
    23472347          # capture block for return
    2348           push @retlist, { block => $peercidr, mtype => $disp_alloctypes{$peertype} };
     2348          push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype };
    23492349        } # merge peers
    23502350        # update the primary allocation info.  Do this last so we don't stomp extra data-retrieval in the loop above
     
    23632363      if ($args{scope} eq 'keepall') {
    23642364        # Convert all mergeable allocations and subs to chunks of pool IP assignments
    2365         push @retlist, @{ _toPool($dbh, $prime, $newblock, $args{newtype}) };
     2365        push @retlist, @{ _toPool($dbh, $prime, $newblock, $args{newtype}, 1) };
    23662366
    23672367      } elsif ($args{scope} =~ /^clear/) {
     
    23742374          _deleteCascade($dbh, $peer_id, 0);
    23752375          # Capture block for return
    2376           push @retlist, { block => $peercidr, mtype => $disp_alloctypes{$peertype} };
     2376          push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype };
    23772377        }
    23782378        if ($args{scope} eq 'clearall') {
     
    23852385        } else {
    23862386          # Convert (subs of) self if not a leaf.
    2387           _toPool($dbh, $prime, $newblock, $args{newtype}) unless $binfo->{type} =~ /.[enr]/;
     2387          push @retlist, @{ _toPool($dbh, $prime, $newblock, $args{newtype}, 1) }
     2388              unless $binfo->{type} =~ /.[enr]/;
    23882389        } # scope ne 'clearall'
    23892390
     
    23932394          next if $peer_id == $prime;  # don't delete the block we're turning into the pool allocation
    23942395          # Capture block for return
    2395           push @retlist, { block => $peercidr, mtype => $disp_alloctypes{$peertype} };
     2396          push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype };
    23962397          next unless $peertype =~ /.[enr]/;
    23972398          # Don't need _deleteCascade(), since we'll just be deleting the freshly
     
    24242425        _deleteCascade($dbh, $peer_id, 0);
    24252426        # Capture block for return
    2426         push @retlist, { block => $peercidr, mtype => $disp_alloctypes{$peertype} };
     2427        push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype };
    24272428      }
    24282429      # Delete any subs of $prime as well
Note: See TracChangeset for help on using the changeset viewer.