Changeset 866 for trunk/cgi-bin/ipdb-rpc.cgi
- Timestamp:
- 05/02/16 17:59:07 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/ipdb-rpc.cgi
r852 r866 199 199 sub rpc_listAllocations {} 200 200 sub rpc_listFree {} 201 sub rpc_listPool {} 201 202 203 sub rpc_listPool { 204 my %args = @_; 205 206 _commoncheck(\%args, 'y'); 207 208 $args{include_desc} = 0 if !$args{include_desc}; 209 210 # convert passed pool from CIDR to an ID, maybe 211 if ($args{pool} !~ /^\d+$/) { 212 die "Invalid pool argument" if $args{pool} !~ m{^\d+\.\d+\.\d+\.\d+/\d+$}; 213 die "VRF is required\n" if !$args{vrf}; # VRF name may not be empty 214 ($pid) = $ip_dbh->selectrow_array("SELECT a.id FROM allocations a JOIN allocations m ON a.master_id=m.id". 215 " WHERE a.cidr = ? AND m.vrf = ?", undef, $args{pool}, $args{vrf}); 216 } 217 218 return listPool($ip_dbh, $pid, $args{include_desc}); 219 } # rpc_listPool() 220 221 202 222 sub rpc_getMasterList {} 203 223 sub rpc_getTypeList {} … … 291 311 _commoncheck(\%args, 'y'); 292 312 293 _validateInput(\%args); 313 if (!$args{block}) { 314 $args{block} = $args{cidr} if $args{cidr}; 315 die "Block/IP is required\n" if !$args{block}; 316 } 294 317 295 318 if ($args{block} =~ m{^(?:\d+\.){3}\d+(?:/32)?$}) {
Note:
See TracChangeset
for help on using the changeset viewer.