Ignore:
Timestamp:
05/15/13 17:26:55 (11 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Hand-backport pieces of the allocate-from-routed-freeblock from /trunk
post-r553. Cherrypick merge not possible due to intermingled changes
relating to the database structure updates.
Includes a handful of harmless references to the new structure.
Will likely cause merge conflicts when the structure update is merged.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/IPDB.pm

    r594 r595  
    504504                                # really be specified in the call for clarity
    505505  my $tlist;
    506   if ($tgroup eq 'p') {
    507     # grouping 'p' - primary allocation types.  These include static IP pools (_d and _p),
    508     # dynamic-allocation ranges (_e), containers (_c), and the "miscellaneous" cn, in, and en types.
    509     $tlist = $dbh->selectall_arrayref("SELECT type,listname FROM alloctypes WHERE listorder < 500 ".
    510         "AND type NOT LIKE '_i' AND type NOT LIKE '_r' ORDER BY listorder", { Slice => {} });
     506  if ($tgroup eq 'n') {
     507    # grouping 'n' - all netblock types.  These include routed blocks, containers (_c)
     508    # and contained (_r) types, dynamic-allocation ranges (_e), static IP pools (_d and _p),
     509    # and the "miscellaneous" cn, in, and en types.
     510    $tlist = $dbh->selectall_arrayref("SELECT type,listname FROM alloctypes WHERE listorder <= 500 ".
     511        "AND type NOT LIKE '_i' ORDER BY listorder", { Slice => {} });
     512  } elsif ($tgroup eq 'p') {
     513    # grouping 'p' - primary allocation types.  As with 'n' above but without the _r contained types.
     514    $tlist = $dbh->selectall_arrayref("SELECT type,listname FROM alloctypes WHERE listorder <= 500 ".
     515        "AND type NOT LIKE '_i' AND type NOT LIKE '_r' ORDER BY listorder", { Slice => {} });
    511516  } elsif ($tgroup eq 'c') {
    512517    # grouping 'c' - contained types.  These include all static IPs and all _r types.
    513518    $tlist = $dbh->selectall_arrayref("SELECT type,listname FROM alloctypes WHERE listorder <= 500 ".
    514         " AND (type LIKE '_i' OR type LIKE '_r') ORDER BY listorder", { Slice => {} });
     519        " AND (type LIKE '_i' OR type LIKE '_r') ORDER BY listorder", { Slice => {} });
     520  } elsif ($tgroup eq 'i') {
     521    # grouping 'i' - static IP types.
     522    $tlist = $dbh->selectall_arrayref("SELECT type,listname FROM alloctypes WHERE listorder <= 500 ".
     523        " AND type LIKE '_i' ORDER BY listorder", { Slice => {} });
    515524  } else {
    516525    # grouping 'a' - all standard allocation types.  This includes everything
    517526    # but mm (present only as a formality).  Make this the default.
    518527    $tlist = $dbh->selectall_arrayref("SELECT type,listname FROM alloctypes WHERE listorder <= 500 ".
    519         " ORDER BY listorder", { Slice => {} });
     528        " ORDER BY listorder", { Slice => {} });
    520529  }
    521530  return $tlist;
Note: See TracChangeset for help on using the changeset viewer.