Changeset 744


Ignore:
Timestamp:
Jun 11, 2015, 5:34:46 PM (7 years ago)
Author:
Kris Deugau
Message:

/trunk

Fill in first major block of rDNS for mergeBlocks(); new allocation is
a container. See #1 and #8.

File:
1 edited

Legend:

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

    r743 r744  
    24472447  }
    24482448
     2449# Make the assumption that any change crossing /24 or /16 boundaries will not come out right.  Reverse DNS
     2450# updates for this operation are already complex enough without handling those edge cases.
     2451# ...  er, how do we detect this?
     2452
     2453  if ($args{newtype} =~ /.[cm]/) {
     2454
     2455    if ($args{scope} eq 'keepall') {
     2456      # Add new rDNS for new container
     2457      _rpc('addOrUpdateRevRec', cidr => $binfo->{block}, name => $binfo->{rdns}, rpcuser => $args{user});
     2458
     2459    } else {
     2460      # Resize rDNS template for $prime
     2461      _rpc('resizeTemplate', oldcidr => "$binfo->{block}", newcidr => $newblock->network.'', rpcuser => $args{user});
     2462
     2463      # Assemble a list of blocks to delete...
     2464      my $cidrlist;
     2465      foreach my $mblock (@retlist) {
     2466        $cidrlist .= $mblock->{block}."," unless $mblock->{block} =~ $newblock;
     2467      }
     2468
     2469      # ... then make slight variant batch delete calls depending on the merge scope
     2470      if ($args{scope} eq 'mergepeer') {
     2471        # Delete separate rDNS for other peers
     2472        $cidrlist =~ s/,$//;
     2473        _rpc('delRevSet', cidrlist => $cidrlist, rpcuser => $args{user}, delforward => 'y', delsubs => 'n',
     2474            parpatt => $pinfo->{rdns});
     2475
     2476      } elsif ($args{scope} eq 'clearpeer') {
     2477        # Delete all rDNS within other peers
     2478        $cidrlist =~ s/,$//;
     2479        _rpc('delRevSet', cidrlist => $cidrlist, rpcuser => $args{user}, delforward => 'y', delsubs => 'y',
     2480            parpatt => $pinfo->{rdns})
     2481
     2482      } elsif ($args{scope} eq 'clearall') {
     2483        # Delete all other records within the new block
     2484        $cidrlist .= $binfo->{block};
     2485        _rpc('delRevSet', cidrlist => $cidrlist, rpcuser => $args{user}, delforward => 'y', delsubs => 'y',
     2486            parpatt => $pinfo->{rdns});
     2487
     2488      } # scope, second level
     2489    } # scope, !keepall
     2490
     2491  } # type grouping for rDNS calls
     2492
     2493
    24492494  return \@retlist;
    24502495
Note: See TracChangeset for help on using the changeset viewer.