diff options
author | Mitch Jackson <mitch@freeside.biz> | 2018-06-29 13:04:33 -0500 |
---|---|---|
committer | Mitch Jackson <mitch@freeside.biz> | 2018-06-29 13:04:33 -0500 |
commit | e2ee874843b19f6c5221f5ce0af90979dba34e57 (patch) | |
tree | 2dcd98ca17c33eeb4163f542bf7038b7aa073f41 /httemplate/misc | |
parent | 04c717c096f556a9ba0e8c4a137e867029c78a1b (diff) |
RT# 30783 Clean up json code for free_addrs
Diffstat (limited to 'httemplate/misc')
-rw-r--r-- | httemplate/misc/xmlhttp-free_addresses_in_block.json.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/httemplate/misc/xmlhttp-free_addresses_in_block.json.html b/httemplate/misc/xmlhttp-free_addresses_in_block.json.html new file mode 100644 index 000000000..801718d35 --- /dev/null +++ b/httemplate/misc/xmlhttp-free_addresses_in_block.json.html @@ -0,0 +1,18 @@ +<%doc> + Return a json array containing all free ip addresses within a given block + Unless block is larger than /24 - Does somebody really want to populate + 65k addresses into a HTML selectbox? +</%doc> +<% encode_json($json) %>\ +<%init> + +my $json = []; + +my $blocknum = $cgi->param('blocknum'); + +my $addr_block = qsearchs( addr_block => { blocknum => $blocknum }); + +$json = $addr_block->free_addrs + if ref $addr_block && $addr_block->ip_netmask >= 24; + +</%init> |