summaryrefslogtreecommitdiff
path: root/FS/FS/addr_block.pm
diff options
context:
space:
mode:
authorjeff <jeff>2008-09-27 03:01:44 +0000
committerjeff <jeff>2008-09-27 03:01:44 +0000
commit4b5d4c82766ef1869d03df63fa1e2f0dd050cb6a (patch)
treec5c814482090bb5e0799db17940250d700857c05 /FS/FS/addr_block.pm
parentf411189684b0ca7cc1b4b3e9be1895607245b595 (diff)
per address block ip auto assignment and auto router selection
Diffstat (limited to 'FS/FS/addr_block.pm')
-rwxr-xr-xFS/FS/addr_block.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/addr_block.pm b/FS/FS/addr_block.pm
index 9d523e1..0fe2476 100755
--- a/FS/FS/addr_block.pm
+++ b/FS/FS/addr_block.pm
@@ -48,6 +48,8 @@ block is assigned.
=item ip_netmask - the netmask of the block, expressed as an integer.
+=item manual_flag - prohibit automatic ip assignment from this block when true.
+
=item agentnum - optional agent number (see L<FS::agent>)
=back
@@ -124,6 +126,7 @@ sub check {
$self->ut_number('routernum')
|| $self->ut_ip('ip_gateway')
|| $self->ut_number('ip_netmask')
+ || $self->ut_enum('manual_flag', [ '', 'Y' ])
|| $self->ut_agentnum_acl('agentnum', 'Broadband global configuration')
;
return $error if $error;
@@ -202,13 +205,16 @@ sub cidr {
Returns a NetAddr::IP object corresponding to the first unassigned address
in the block (other than the network, broadcast, or gateway address). If
-there are no free addresses, returns false.
+there are no free addresses, returns false. There are never free addresses
+when manual_flag is true.
=cut
sub next_free_addr {
my $self = shift;
+ return '' if $self->manual_flag;
+
my $conf = new FS::Conf;
my @excludeaddr = $conf->config('exclude_ip_addr');