projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
switch to Email::Sender and add options for every kind of mail encryption & authentic...
[freeside.git]
/
FS
/
FS
/
addr_block.pm
diff --git
a/FS/FS/addr_block.pm
b/FS/FS/addr_block.pm
index
5815f1a
..
0fe2476
100755
(executable)
--- 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 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
=item agentnum - optional agent number (see L<FS::agent>)
=back
@@
-124,7
+126,8
@@
sub check {
$self->ut_number('routernum')
|| $self->ut_ip('ip_gateway')
|| $self->ut_number('ip_netmask')
$self->ut_number('routernum')
|| $self->ut_ip('ip_gateway')
|| $self->ut_number('ip_netmask')
- || $self->ut_agentnum_acl('agentnum', 'Engineering global configuration')
+ || $self->ut_enum('manual_flag', [ '', 'Y' ])
+ || $self->ut_agentnum_acl('agentnum', 'Broadband global configuration')
;
return $error if $error;
;
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
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;
=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');
my $conf = new FS::Conf;
my @excludeaddr = $conf->config('exclude_ip_addr');